On Sat, 6 Nov 2004 19:06:01 -0800, "Lisa Sokoloski" <Lisa
Van,
I have a question regarding a similar issue. I am setting up a database at
work. Similar to sales order database. I created a Header table and a
detailed table. My primary key for the detailed table is an autonumber.
I do not understand why the autonumber jumped from 00127 to something like
374,68740! I can believe the numbers will be unique, however, I wanted a
sequencial with gaps only caused by deletion of a record. What went wrong
for me?
Did you perhaps run an Append query? Or Replicate the database? An
Append query may introduce a gap, sometimes a huge one. Replicating
will make all autonumberfields random.
Short take: If you care anything about the value, or plan to display
it to people who care about the value, NEVER USE AUTONUMBERS. They're
going to be unique - but that's *all* that you can count on for their
value. If you want sequential numbers, use a Long Integer field and
program it yourself; see the innumerable threads in this newsgroup
about "Autonumber" or "Custom Counter" using
http://groups.google.com
advanced search.
Also, in my entry form I have the header table with a subform of detail
table for entry. If for some reason I exit the form and go back to it, the
last entry stays at the end meaning, it appears last no matter what is
entered afterward.
Table HAVE NO ORDER. They'll usually be presented in Primary Key
order, as a convenience, but on some subforms you can't count on this
either. If you care about the order, base the Form/Subform on a Query
sorted by one or more fields in the table.
John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps