Duplicate Key Record Index Violation

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

I have a table with several thousand records where Access is informing me
every time I attempt to save it or any data that there is a duplicate record
in the Primary Key index, which is RecordID.

I am unable to locate the duplicate record(s) and have tried everything I
know to find the duplicate manually and fix it. I have even tried to use a
MakeTable query to remake the table without the KeyRecord field, but then I
don't have the KeyRecord file, which I need for lots of records.

How do I locate and/or fix this duplicate so that I don't have to recreate
this entire table?
 
A

Allen Browne

If you are sure there is no duplicate value, and the primary key field is an
AutoNumber, it may be that the Seed is set too low. So, when it tries to
save the next record, it can't (becuase it's trying to use a number that has
already been used.)

Compacting the database might reset the seed. If it is an attached table,
compact the actual file where the data resides.

If that doesn't solve it, there some code in this link that looks through
your tables and resets the Seed of any that are negative or lower than the
maximum value:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

The article also discusses what causes the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top