Autonumber start

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have an autonumber field that I'd like to start at a
certain number. Is there a way to do this?

Also, I've noticed that if you begin a record but then
delete it, the autonumber used for that deleted record is
not used again. Is there a way to ensure that the
autonumber field increments from the last saved record?

Thanks in advance,

Jason
 
Two ways to set the starting point for an autonumber:
1. Append a record with one less than the number you want, and delete it.
Details:
http://allenbrowne.com/ser-26.html

2. Use ADOX to set the Seed property of the Column.
Example of setting this for all tables:
http://allenbrowne.com/ser-40.html

Access is a multi-user environment. An autonumber is assigned when you begin
entering a new record. Potentially, another user could also have begun (even
completed) adding another record before you decide to abort yours, so No,
there is no way to reassign the autonumber, short of compacting the database
after any aborted entry, or coding your own replacement for autonumber.
 
Jason said:
I have an autonumber field that I'd like to start at a
certain number. Is there a way to do this?

Also, I've noticed that if you begin a record but then
delete it, the autonumber used for that deleted record is
not used again. Is there a way to ensure that the
autonumber field increments from the last saved record?


Jason, since Allen's answered you question, I just want to
add a caution that you should not care whether an autonumber
has gaps or is out of order. All you should require is that
it be unique.

If you're using an autonumber field for anything that a user
might see, then you're going down the wrong path.
 
Back
Top