auto number

J

judith

I am priming up an auto number field in a table with a particular number and
then want the next records to be appended with the next numbers in the
sequence. If I prime back to a prior number the sequence seems to start wher
it left off.
eg. start at 1000 and the next 2 records are 1001 and 1002

If i then reset to 1000 the next 2 records go to 1003 and 1004

maybe I could remove the field and then reinstate it but how do I do this
using code?

Thanks
 
M

Marshall Barton

judith said:
I am priming up an auto number field in a table with a particular number and
then want the next records to be appended with the next numbers in the
sequence. If I prime back to a prior number the sequence seems to start wher
it left off.
eg. start at 1000 and the next 2 records are 1001 and 1002

If i then reset to 1000 the next 2 records go to 1003 and 1004

maybe I could remove the field and then reinstate it but how do I do this
using code?

You are using autonumber inappropriately. An AutoNumber
field is only useful as a surrogate primary key where it's
only requirement is that it be unique. As a surrogate pk,
the number has no meaning to anyone and therefore should not
be displayed where users can see it (because human nature
tries to make up a meaning such as this one comes after that
one or why is that number missing).

If you really need to have consequitively numbered records
(fairly unusual), then you will have to write code behind a
form to create them according to whatever rules you want to
follow.
 

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