D delaikhi Registered User. Local time Today, 14:34 Joined Sep 28, 2013 Messages 42 Oct 2, 2013 #1 What would be an expression if I want a default value is equal the last record + 1? Thanks
bob fitz AWF VIP Local time Today, 22:34 Joined May 23, 2011 Messages 4,806 Oct 2, 2013 #2 Where do you want to do this calculation. In a form, or in a query.
D delaikhi Registered User. Local time Today, 14:34 Joined Sep 28, 2013 Messages 42 Oct 2, 2013 #3 Bob Fitz: on a form please
bob fitz AWF VIP Local time Today, 22:34 Joined May 23, 2011 Messages 4,806 Oct 2, 2013 #4 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.
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.
D delaikhi Registered User. Local time Today, 14:34 Joined Sep 28, 2013 Messages 42 Oct 2, 2013 #5 Thanks, Bob!
bob fitz AWF VIP Local time Today, 22:34 Joined May 23, 2011 Messages 4,806 Oct 3, 2013 #6 Alternatively, may be better to set the Default Value Property of the control to: = Nz(DMax("NameOfField","NameOfTable"),0) + 1
Alternatively, may be better to set the Default Value Property of the control to: = Nz(DMax("NameOfField","NameOfTable"),0) + 1