| re: AutoNumber and Filling a text box display with autonumber
1. If you put a control on a form and bind that control (through
controlsource property) to the autonumber field, you will see the new
autonumber value the moment someone types the first character into a new
record. this assumes that you are using a bound form and bound controls for
adding a new record.
2. The behavior you describe is by design. the autonumber type does not go
back and re-use a number for any reason. If you add 100 records to a brand
new empty table, the autonumber field numbers will be from 1 to 100. If you
delete the row that has id=50, that number is gone. The next new record
gets id 101.
3. There is no really good reason to show users an autonumber field. Its
main use is as a primary key, purely to identify "the row with id #nnnn".
Whether there are gaps in the numbers or not is immaterial to that use of
the field.
If you want to guarantee some sequential numbering for some other purpose,
you can do so in code. You can even re-use numbers in the number field you
create for that purpose, though it is rare to have a really good reason to
do that. |