Autonumber skipping numbers

T

T

I built a web app that uses the autonumber for an order id in an Access 2000
db. Occasionally, a number or two is skipped (the customer insists they are
not deleting records). The asp code is doing a rs.update to insert the new
record.

I have done quite a bit of research but have not found this specific case.
Has anyone seen this or can explain what is happening?

Thanks in Advance!
T
 
L

Lynn Trapp

The value in an Autonumber field is assigned as soon as a user starts
entering data in the other fields. If the user fails to finish completing
the record and leaves without causing the record to be saved, the value in
that field is lost forever. Autonumbers are designed to provide a nearly
100% unique value for linking tables together. It is not good to attempt to
use it as a sequential numberer... it will eventually develop gaps.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
R

Rick B

An autonumber is incremented when a user starts adding a record. They most
likely started adding a record, then hit escape.

Auto numbers WILL have gaps. They were never intended to prevent gaps.

In most cases, your users should never even see an autonumber field since it
is just intended to allow unique keys for your records. Autonumbers should
not be used for any field that the client will be referenceing (invoice
number, customer number, etc.) For those, use some variation of DMAX to
obtain the highest number and add one to it.
 
T

T

Yep, that is what I am finding out that I should not be using that as a user
viewable number. I'll have to make some changes to address that as is
suggested. Thanks.

Now, in this case, the web app is adding the entire record at once. So the
user can not halfway insert a record. Perhaps there was some type of race
condition that occured that caused this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top