Just curious, when I imported data from a spreadsheet with 519 lines into an empty table, why did my autonumber keys start at 56,557,618? How big can this get? I don't want to end up running out of digits for my primary key field as I didn't even start on the project and I expect to be dumping spreadsheets in quite regularly.
Access remembers the last ID it gave out even on an empty table. To reset the autonumber you have to compact/repair the database after emptying the table
Also the autonumber is a long integer which in Access can go up to 2,147,483,647
You can reset the autonumber without compact and repair using :
CurrentDb.Execute "ALTER TABLE tblTable ALTER COLUMN ID COUNTER(1,1)"
You must make sure the table is empty before running the SQL or you will get Access trying to create duplicate autonumbers.
You can also reset the autonumber by creating an append query that includes the autonumber column. Once a row is appended then the number will be set to the appended value + 1.
Doing this you have to be careful that the value is not less than the highest current value.
For e.g.
INSERT INTO tblName ( id )
SELECT [tblName]![id]+1 AS [New Value]
FROM tblName
GROUP BY [tblName]![id]+1, tblName.id
HAVING (((tblName.id)=(Select max(id) from tblName)));
Would reset the autonumber to + 2 of the last number. Note you would have to include any mandatory columns and delete the new row afterwards.