autonumbering

T

tom

I have a table set up where the primary key is set up as
an "autonumber". Users enter new records via a data entry
form and each record is intended to increment +1 as they
are created.

I have now run into a situation where we hav 50 or so
records and now the autonumbering has gone back to 0, 1,
2, etc. We already have records with these ID numbers.

How do I get the autonumbering back on track to "51" where
it is supposed to be?
 
J

Joseph Meehan

You have a problem.

If you still have records number 1, 2 etc and it is duplicating existing
numbers, you have a database problem. I would try a repair and compress,
but I am not at all sure that will help.

If you have deleted those records and the originals are no longer in the
table, then you just don't understand AutoNumber.

AutoNumber does not number consecutively, it numbers uniquely.
Sometimes consecutively sometimes not. There is not guarantee that it will
number consecutively. To do that you need to add your own numbers in code.
 
V

Van T. Dinh

See the Microsoft Knowledge Base:

* A2K: <http://support.microsoft.com/?id=257408>

* AXP: <http://support.microsoft.com/?id=291162>

OTOH, you misunderstood AutoNumber Fields. The whole
purpose of AutoNumber Field is to provide uniqueness to
each Record in your Table. AutoNumber Field value will
develop gaps, become random and even negative. The actual
value allocated to each Record shouldn't matter (since it
exists only to provide uniqueness) and your users
shouldn't even see the values.

If you need a consecutive sequence of numbers, DON'T use
AutoNumber and write your own code to create the custom
number sequence.

HTH
Van T. Dinh
MVP (Access)
 

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