If these are Access tables, you should see the AutoNumber assigned at the
instant you start the new entry (i.e. when Form_BeforeInsert fires.) The
unique number is assigned to this user, and will never be assigned again.
Even if you abort the new record, the autonumber is not reused. Therefore
another user starts a new record before you save yours, they are not given
the same AutoNumber.
If your database is not behaving like that, then something is different.
Perhaps they are not JET tables, but attached tables from another database.
Or perhaps they are not AutoNumber fields, but numbers assigned by code. Or
perhaps something is messing it up (such as a main form and subform, with
the same autonumber field in LinkMasterFields and LinkChildFields.)
In general, "No Locks" (also known as optimistic locking) gives the best
results.
And back to the previous topic, if you only want to assign those values at
the new record, it might be better to use the form's BeforeInsert event
rather than OnDirty. BeforeInsert is more reliable, and only fires for new
records.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<pa****@yahoo.comwrote in message
news:11*********************@s33g2000prh.googlegro ups.com...
Allen,
That 3rd answer is solving our problem. I moved the onCurrent events
to onDirty events. This will save a lot of headaches. Thank you!
Maybe you have an answer for a similar issue. Users add a new record
and do not enter anything to trigger the autonumber. Another user
will then be unable to commit their new record to the table due to
some conflict. I have it set to locking the edited record, but I
think this might not include a new non-committed record as something
being "edited".