Automated calculation

delaikhi

Registered User.
Local time
Today, 14:34
Joined
Sep 28, 2013
Messages
42
What would be an expression if I want a default value is equal the last record + 1? Thanks
 
Where do you want to do this calculation. In a form, or in a query.
 
Bob Fitz: on a form please
 
You could try this:

In the After Update event of the control (I assume this will be a text box) put the following code:

Me.ActiveControl.DefaultValue = Me.ActiveControl + 1

You will need to enter an appropriate value once, after that it should auto-fill with the incremented value.
 
Alternatively, may be better to set the Default Value Property of the control to:

= Nz(DMax("NameOfField","NameOfTable"),0) + 1
 

Users who are viewing this thread

Back
Top Bottom