Auto Populate a Field

  • Thread starter Thread starter Guest
  • Start date Start date
David,

Well, an Autonumber field does this, pretty much, though it does have
limitations.

Alternatively, on the form that you are using to enter data to the
table, you can set the Default Value property of the control for the
field to the equivalent of...
DMax("[NameOfField]","NameOfTable")+1

However, this will only work on a Single view form. If you are using a
Continuous view form, you will need to use the Before Insert event of
the form, to apply a macro or VBA procedure. If a macro, you would use
the SetValue action, with arguments like this...
Item: [NameOfYourField]\
Expression: DMax("[NameOfField]","NameOfTable")+1
 
Back
Top