This sort of thing is generally done at form level. In the Current event
procedure of a form based on the table look up the highest value in the field
and add 1, e.g.
Me.YourField.DefaultValue = """" & DMax("YourField", "YourTable") + 1 & """"
Note that the DefaultValue property is a string expression regardless of the
data type of the field in question, hence the delimiting quotes characters in
the above code. Most of the time omitting them won't matter, but sometimes
they are essential, so its prudent to include them nevertheless.
This works fine in a single user environment, but in a multi user
environment on a network can give rise to conflicts as two or more users
could be adding records simultaneously and get the same number. There are
various ways around this, one of which can be found at the following link,
which also allows the number at which the sequence will start when the next
record is added to be reset manually:
http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23839&webtag=ws-msdevapps
Ken Sheridan
Stafford, England