access 2003 - autonum question

PaulW
2StarLounger
Posts: 125
Joined: 17 Feb 2010, 16:25

access 2003 - autonum question

Post by PaulW »

I have a form with the "ID" as an autonum. When the form becomes dirty the autonum field is incremented. If I "UNDO" before finishing the record the autonum is still "used" even though there is no data in the bound table. My user is confused as to where the missing "numbers" are. Can you help?

TIA
PaulW
Lost Wages, NV USA
(former Cobol Programmer)

User avatar
HansV
Administrator
Posts: 78465
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: access 2003 - autonum question

Post by HansV »

An AutoNumber field is a unique but meaningless identifier for a record. AutoNumber fields are used to ensure that each record in a table has a unique identifier; this is very handy for building and maintaining relationships between tables/

Values that have already been assigned but not saved, will not be reused. Neither will AutoNumber values of deleted records be reused. The only exception is when you compact the database - Access should then start at the highest used number plus one. (Gaps in between numbers still won't be reused).

End users shouldn't need to see AutoNumber fields, so gaps in the sequence shouldn't matter. If you really need a sequence number without gaps, you should create another field for it, not of type AutoNumber, and assign its values yourself.
Best wishes,
Hans

PaulW
2StarLounger
Posts: 125
Joined: 17 Feb 2010, 16:25

Re: access 2003 - autonum question

Post by PaulW »

Hans,

Thanks. I needed something from the guru to satisfy my auditor user. I just did not know about the assigned, but not saved feature.
PaulW
Lost Wages, NV USA
(former Cobol Programmer)