Hi Lilian,
You should not consider an autonumber field as a valid record counter; it
should only be considered as a *meaningless* value. If a person starts to add
a record, but presses the Escape button to undo their edits, the autonumber
will not reuse the value. Likewise, if a record is deleted, the autonumber
does not automatically reset for all remaining records. Thus, it should not
be considered a reliable indicator of record count.
Normally, deleting all records from a table and then performing a Compact
and repair will reset the autonumber field to 1 (as long as randomize is not
set as a property). Do you have the latest service pack installed for the JET
database engine? Here are some links that I recommend that you follow, to
ensure that your system is properly updated:
How to keep a Jet 4.0 database in top working condition
http://support.microsoft.com/?id=303528
In particular, follow the three links:
Verify that the latest operating system service pack is installed
Verify that the latest Microsoft Jet service pack is installed and
Verify that the latest service pack for your version of Office is
installed
Also recommended: Install the latest version of MDAC (Microsoft Data Access
Components)
http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c
That said, if the autonumber still refuses to reset to 1, I would try Access
MVP Allen Browne's code. Go to this article:
http://allenbrowne.com/ser-40.html and scroll to the very bottom. Follow the
two links:
For code to examine a table and find out what the Seed of the AutoNumber is,
see GetSeedAdox().
For code to reset the Seed for one table only, see: ResetSeed().
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________