Autonumber lost its sequence.

F

fofikos

I created a database for a certification authority meaning that all
certificates must have a continuous numbering.

My client reported that today the database skiped two numbers up than it
should; I suspect that the client created the records and deleted them, but
the form does not allow deletion of records! And there is no other way to
input to that table (unless intentionaly).

Any idea what else could cause that?
What can i do to reuse these two numbers?


THANKS
Vasilis
 
N

Nikos Yannacopoulos

Vasili,

Deletion of records directly in the table is a possibility, though not
necessarily the only one. The important thing here is that, due to the
nature of autonumber, it is not suitable for cases like yours where you
require sequential numbering. Since all data entry is done through a
form, a more appropriate way would be to use a number field instead, and
make use of the Default Value property of the control bound to it on
the form to calculate the next number by means of an expression like:
DMax("[ID_Field]","Tablename") + 1
Note that the control should be disabled (if not hidden) so the user
can't change the number.

HTH,
Nikos
 
A

Allen Browne

When you *begin* adding a record, Access assigns the next available
autonumber.

If you then press <Esc> twice, it aborts the entry of the record. But the
number has already been assigned, and it will not be assigned again. This is
a very common scenario.
 

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