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

problems setting user defined

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

Problems setting a user defined primary key

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

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

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.