JB

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.
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top