I have a table in an Access database with an autonumber field.
When I delete all the records from the table, the autonumber remembers the last number.
Does A
There is another way that doesn't require altering the table or compacting and repairing. It will work better for you if you have a distributed database. As of 2000, Access will accept an insert value into an autonumber field and start incrementing there. Do it in a query or in code like this.
CurrentProject.Connection.Execute "DELETE FROM Mytbl"
CurrentProject.Connection.Execute "INSERT INTO Mytbl(ID) VALUES(0)"
CurrentProject.Connection.Execute "DELETE FROM Mytbl"
Note: Put adExecuteNoRecords after the execute command for better performance. e.g. CurrentProject.Connection.Execute sql, , adExecuteNoRecords