The Autonumber is not consistant. It goes from number 157 to 24597. I am
trying to make it go in sequence. How do I do that?
An Access Autonumber has one purpose, and one purpose ONLY: to provide a
unique identifier. This is a rather extreme example of its normal behavior. If
you delete a record, that record's autonumber will never be reused; if you hit
<ESC> an instant after starting a new record, an autonumber will be used up
and will leave a gap; if (as probably happened here) you fill a table using an
Append query, you may get a very large gap. This is intended and expected
behavior.
If you want numbers to be sequential and gapless... don't use an Autonumber.
Use a Long Integer or other appropriate datatype, and use VBA code to
programmatically assign the next number. You'll need to be careful in the code
and make decisions about what you will do when a record must be edited or
deleted (you really DON'T want to renumber records 3 through 22147 when you
realize that record 2 was a test record that shouldn't be there...)
There are plenty of examples on this group and elsewhere for "Custom Counters"
- you can use
http://groups.google.com advanced search, or post back with some
details if you need more help.