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

error message creating primary

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

ResolvedVersion 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:

Related tables

When you have related tables such as Customers and their Orders, the Customer table is the Primary table.

Open the Customers table in datasheet view and go to the Home Tab and Records group. Click on the More option and choose Subdatasheet and then click on Subdatasheet again. Now choose the related table (Orders) and click ok.

Now you can click the + symbol by each company to show the related orders.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.