Autonumber Field Re-started at a Lower Number

  • Thread starter MartyTheMSAccessGuy
  • Start date
M

MartyTheMSAccessGuy

I have a table in a database that I received an error on that there were
duplicate values in the indexes being created.... I initially thought it was
programming that was incorrect (most records in this database are added
through code), but, when getting at the root database I found that the
autonumber field was not being properly incremented. The table had only one
key indexed field that is also an autonumber field. The prior values were
9275, 9276, 9277 and almost all for the prior few hundred records were pretty
much sequential with no skipped records. When manually trying to add a
record, the next number automatically added as the autonumber was 95, 96...
If the next number happened to be missing from the beginning of the table it
worked, but most would not. Prior to doing all this, I compacted and
repaired this database and I did it again, but, it did not correct this
problem. I have read in Microsoft Tech Net how to set the next record to be
a higher initial sequence number, but, more importantly I wanted to know how
this would have occurred in the first place and what I can do to prevent it.
Has anyone else ever experienced this problem? There are a number of users
who access this database. The main back end database is on a PC where a
specific BetaCERT application uses it as the data storage area. There are
several other users who access the database using MS Access 2000. When
doing debug, I noticed that someone had loaded MS Access 2003 on the same PC
where the back end database is stored. Normally the database is not
accessed via MS Access on the PC it is run from (e.g. MS Access 2003 should
not normally be used to access the back end database, but could be used by
accident). I have in the past had a nightmare with trying to have a number
of users access an MS Access 97 database with both Access 97 and 2000.
Could this be the same as with 2000 and 2003? From all I have read, 2003
uses MS 2000 as the default database format.

Help please.
 
A

Allen Browne

There are several flaws that can trigger this issue in any JET 4 database
(Access 2000, 2002, or 2003).

The common ones are listed here:
Fixing AutoNumbers when Access assigns negatives or duplicates
at:
http://allenbrowne.com/ser-40.html

The article also contains the code to check through all tables in your
database, and fix the ones that have 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