error message creating primary

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Error message when creating primary key Access 2003

Error message when creating primary key Access 2003

resolvedResolved · Low Priority · Version Standard

Jane has attended:
Access Introduction course
Access Intermediate course

Error message when creating primary key Access 2003

I'm trying to import data from a text file that contains duplicate data however, this is correct so I have allowed duplications when going through the import process. It is important that these duplicate ID's are the Primary Key.

I keep getting this message

"Error creating primary key on field 'Person ID' (The changes you requested to the table were not successful because they wouldc reate duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit dupliate entries and try again."

Once this message is received data does appear in a new Table however I'm worried that some of the information may have been affected.

My colleague who currently uses Access 2000 followed the same process and did not get an error message.

Any ideas how to get round this other than loading Access 2000 on my pc?

RE: Error message when creating primary key Access 2003

Hi Jane, Thank you for your post, In answer to your question, as I am sure you know; if you create a Primary key (on a Unique field) the field is set to the Index property of Yes (No Duplicates), this could be the reason for your initial error message. However if you change the properties to Yes (Duplicates OK) then you cannot use that field as a Unique identifier although you can still use the field in relationships if you so wish. If you have chosen to accept the Index of Yes (Duplicates OK) your data should be OK and your database should operate as required, although you will not be able to set Referential Integrity. My suggestion is that if your data will allow then you should change the index to allow Duplicates. I hope that helps, although I think you have already come to that decision, best regards Pete.


 

Access tip:

Closing form after a certain time period

To make a form close automatically after a certain time period, you need to assign the close function to a macro.

Save the macro and ope up the form in design view. open the Properties sheet.

In the TimerInterval property enter the length of time you want the form open for. This should be in milliseconds, so for instance if you want the form open for 5 seconds enter 5000, for an minute enter 60000.

You now need to attach your macro (to execute the Close action) to the OnTimer event property of the form.



View all Access hints and tips


Server loaded in 0.08 secs.