Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autonumber skipping numbers

Status
Not open for further replies.

childlead

Technical User
Jul 13, 2001
21
0
0
US
Hi.

Does anyone know why this is happening to me? Also, the autonumber doesn't correspond with record number. For example, the autonumber might be set to 30 but the record number is 27. Why is this? I haven't deleted any records. Shouldn't the autonumber correspond with the record number? Any insights would be greatly appreciated. Thank.s
 
I've noticed this as well and it seems to happen if you abort and entry halfway through. For instance, you start to enter data, an autonumber is created, and then change your mind, so you press the escape key. Even though you have aborted, that number has been used up so when you eventually enter a record the next consecutive number is displayed.

Hope this helps.
 
If you abort while adding a record, Access does not use the number again. In other words, if your adding a record, and it is number 30, and you hit escape during the add process, the next auto number will be 31, not 30.

HTH

 
There have been numerous posts on this issue, if you use the keyword search you'll find many answers to why access does this and how to recover numbers if possible. MichaelRed also has an excellent FAQ in the Microsoft: Access Tables and Relationships forum (Forum700) on how to make your own autonumber that will always have sequential numbers.

HTH Joe Miller
joe.miller@flotech.net
 
You might want to Compact the Database. Although it won't fill in a number that has already have been missed, it does reset numbers that have been deleted at the end of the record set.

For Example:
AutoNum
-------
1
3
4
5 *Deleted*
6 *Deleted*

Adding the next record would give the number 7, but if the database is compacted before another record is added, then the autonumber would re-start at 5.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top