increment a value in a text box

  • Thread starter Thread starter john
  • Start date Start date
J

john

How do I automatically increment the value in a text box
which is type integer when I add a new record? I am trying
to create a counter that increments each time a new record
is added. This seems like a trivial problem but I cannot
find any documentation on it. Help would be appreciated.
 
John,

Are you entering new records through a form? I'll assume you do.In that
case, all you need to do is use the control's Default Value property, with
an expression like:

=DMax("[FieldName]","TableName") + 1

where TableName and FieldName are the names of the undrlying table and the
field the control is bound to.

HTH,
Nikos
 
Try looking at the forms AfterInsert Event. This event only fires whe
you have added a new record to the underlying dataset for the form.
Just update a textbox each time you come to the event
 
Back
Top