Hi June7 (et al)
I just tried that (Access 2010) , and encountered what I would call a nasty bug.
I created a little 2-field test table, with autonumber a key, and added a few records (7)
Then I did this in the immediate window:
currentdb.Execute "Delete from table1 where key = 2"
No problem.
Then : currentdb.Execute "Insert into table1 values (2,""again"")" to put the record back.
No apparent problem - the table looks OK.
Then : currentdb.Execute "Insert into table1 (field1) values (""new record"")", dbfailonerror
Should give new a new record with the next autonumber, right?
But I get error 3022 - duplicate value in index or primary key.
The re-insert of the record with key=2 reset the autonumber counter, so the next insert failed! (It actually tries to use key=3)
This behaviour can be seen too if I try to add a new record directly in table view - the error is obvious
Not good - I would call it a bug.
So, I would say you cannot specify an autonumber on insert, or you may encounter serious problems later.
John