problems setting user defined

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

Forum home » Delegate support and help forum » Microsoft Access Training and help » Problems setting a user defined primary key | Access forum

Problems setting a user defined primary key | Access forum

resolvedResolved · Urgent Priority · Version 2003

Pasquale has attended:
Access Introduction course
Access Intermediate course
Access Advanced course

Problems setting a user defined primary key

I'm in the process of optimising old data in Excel, importing the data as tables and am trying to set a postcode as the primary key, but keep on getting this error message:

The Changes you made to the table were not successful because they would create duplicate values in the index, primary key or relationship. Change the date in the field or fields that contain duplicate data, remove the index, or redfine the index to permit dulpicate entries and try again.

How do I overcome this?

RE: Problems setting a user defined primary key

Hi Pasquale

Thanks for your question.

A primary key field must contain a unique value for each record. The message you are getting indicates that this is not the case, and that you have records that share the same postcode.

Thus you cannot use the postcode as a primary key. You must either use a different field as the primary key, or use a compound key that combines the postcode with another field.

Regards

Stephen

Sun 18 Apr 2010: Automatically marked as resolved.


 

Access tip:

Hide Access Tables

One method of stopping your Access tables appearing in Database window, is to rename the table(s) with the prefix usys.

This converts the table into a system object, which cannot be viewed in the Database window.

You can show system objects in the Database window by the following:

Step 1: On the Tools menu, click Options.
Step 2: Click the View tab.
Under Show, select the System Objects check box.
Click OK.

View all Access hints and tips


Server loaded in 0.09 secs.