Duplicate Primary Key

  • Thread starter Thread starter Corinne
  • Start date Start date
C

Corinne

My database uses an autonumber for a primary key. The properties are set to
long integer and Index (no dupilcates) Everything has been working fine
until today when I tried to add a new record. I have a command button on the
form to do this.
I put in the details but I got an error message when I tried to go to one of
the subforms on the main form to add further data. After some time of
mucking about trying to get things working I went to the main table and
tried to add a record there. The same message came up, and I discovered that
it was using a number in the primary key that had already been used. When I
closed the form and tried again I finally found it was using a new number,
one that hadn't been used but it didn't increment from the bottom of the
numbers it used a number in the middle, where a record had previously been
deleted.
I hope this makes sense and does anyone have any idea as to why this is
suddenly happening.
Thanks in advance
Corinne
 
If someone has appended a record using a lower free
number (a number freed by deleting)as the index, then the
autonumber will return to the next record number above
it.
To stop the error, you append a new record at one over
the highset number in your index the autonumber will
continue from there.
 
Thanks for the suggestion I have tried appending a new record but that
didn't make any difference. Anyone have any other ideas.
 
This was a bug in the original release of Access 2000 IIRC. It was fixed in
one of the Service Releases.

Have you applied all Service Releases / Service Packs to your Office /
Access installation?
 
Back
Top