JB

  • Thread starter Thread starter 123
  • Start date Start date
1

123

Hi there,

How do u increase the value of a field by 1 from the previous record in the
form and keep it as a default value.

Thanks in Advance,
JB.
 
JB,

If your form is a "single view" form, you can use the Default Value
property of the control on the form. Set it to...
DMax("[NameOfYourField]","NameOfYourTable")+1

Howeverr, if your form is in continuous view, this won't work. In
this case, you can put code on the form's BeforeInsert event, like
this...
Me.NameOfField = DMax("[NameOfField]","NameOfYourTable") + 1

- Steve Schapel, Microsoft Access MVP
 
Back
Top