Compacting and repairing the database will reset the autonumber, but
if sequential numbering is important then you should not rely on an
autonumber, but use a straightforward long integer number data type
and compute the next number when inserting a new record.
This is commonly done by putting code along theses line in a form's
BeforeInsert event procedure:
MyID = Nz(DMax("MyID","MyTable"),0)+1
This is fine in a single user environment, but can cause a conflict in
a multi-user environment on a network if more than one user is adding
a new record simultaneously, in which case all but the first to save
the record would get an error resulting from the key violation.
Roger Carlson has a simple way of handling this at:
http://www.rogersaccesslibrary.com/...?TID=395&SID=83z7c11zc7b721d2a1e51989c53d7ffb
Or there is my more complex solution at the following link, which also
includes provision for resetting the number at which the sequence
restarts when the next new record is inserted:
http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23839&webtag=ws-msdevapps
Ken Sheridan
Stafford, England