Autonumbering problem - keeps incrementing even though deleted row

  • Thread starter Thread starter BP
  • Start date Start date
B

BP

hi,

I have an primary key autonumber field that goes from 1, 2, 3... -> 115+
records. I have manually deleted alot of rows till currently left about 45
records. But whenever i add a new row, the number starts from the last 115
number.

I'm not sure what caused this or even if this is normal behavior?
 
Hello,

Is there anyway to prevent this from happening?
I require the autonumber field number to go in sequence. Now it jumped from
45 to 115.
I could delete off the autonumber field column and re-make 1 but it is a
hassle as I would need to frequently to delete rows manually in the table so
any good recommendations would be helpful.

Thanks!
 
Autonumber is not meant to provide unique numbers, not guaranteed to be in
sequence. If you need an ubroken sequence, you must generate your own
numbers, e.g. by adding 1 to Max(yourIDfield).
-TedMi
 
Here is a URL that addresses your concern.
http://support.microsoft.com/kb/210194

The following is probably the easiest way to accomplish your objective, but
it could result in duplicate numbers in a multi-user environment. If you use
the following you should take appropriate steps to ensure that no one other
than you can create the sequential number in order to avoid the possibility
of duplicate numbers.

Open the properties window of the form and enter the following line of text
into the "Default Value" of the MySeqNum property window.

=Nz(DMax("MySeqNum", "tblMyTable"), 0) + 1

Jack Cannon
 
Back
Top