AutoNumber Decrement

cytomatrix

New member
Local time
Today, 08:50
Joined
Mar 14, 2005
Messages
5
I have a database in access that allows user to create a record that uses the autonumber to create the primary key. On occassion, the autonumber generates a key, but the user may later choose to undo the insertion of that record. This all works fine except, after the user undo's the insertion of a record, the autonumber has still be incremented, which cause gaps in the primary keys for the records. How can I decrement the autonumber value (in VBA preferably) to prevent these gaps in the autonumber sequencing?

Thanks,
cyto
 
You dont (except maybe if you do a compact) it should not matter, autonumbers should be meaningless anyway.

Regards
 
Thanks namliam. But, it does matter to me especiallly when using autonumber for fields like customer Id or member ID. Is there a way to reset the autonumber?
 
Then you'll have to create your own "Autonumber" using DMax+1, there have been many posts on the subject
 
cytomatrix said:
Thanks namliam. But, it does matter to me especiallly when using autonumber for fields like customer Id or member ID. Is there a way to reset the autonumber?
Sorry same answer :(

You (like rich says) will have to use your own Key. (many threads on the forum). Again, an autonumber should (99 out of the 100 times) be meaningless and invisible to the user.

Regards
 

Users who are viewing this thread

Back
Top Bottom