When you import existing data into the new table you can copy the existing
values into the field even though it is specified as autonumber. If you're
not importing any existing data, you can run an append query to append a
single row with a specified receipt number.
Once you've done either one of those, the auto-numbering might fail to work
correctly. It may continue assigning values starting at 1, ignoring the data
you've entered. Compacting used to fix the autonumber seed, but it hasn't
for some time now, definitely not since Access 2003. Allen Browne's website
has the code to restore correct auto-numbering starting from the highest
existing data value.
http://www.allenbrowne.com/ser-40.html
Allen has also posted this code to reset the autonumber initial seed value,
and optionally the increment to be used between autonumbers.
1. Create a new query.
2. In first dialog, choose Design view.
3. Cancel the second dialog (Add Table.)
4. Switch to SQL View (left of ribbon.)
5. Paste this in (first value is the seed, second is the increment):
ALTER TABLE [Table1] ALTER COLUMN [ID] COUNTER(686486, 1);
6. Substitute your table name for Table1, and the name of your autonumber
field for ID.
7. Run the query.
8. No need to save the query.
However, if you need to assign receipt number values during ongoing
operations, an autonumber is probably not the best approach. If you add a
new row and then delete it, the deleted receipt number will not be re-used.
Autonumbers are only quaranteed to be unique, and are not suitable if you
don't want any holes in the numbering sequence. You'd be better off
assigning the receipt numbers for new rows in your own code in that case.