Solved Dmax Sequential Numbering Start Value

Tophan

Registered User.
Local time
Today, 11:24
Joined
Mar 27, 2011
Messages
374
Good morning,

I am using Dmax to create a unique sequential numbering in a form. I would like the first entry to start at 1, however it keeps starting at 0. I tried changing the default value in the table design to 1, but it keeps going back to zero.

I put the below code in the forms Before Insert event

Code:
TaskNo = Nz(DMax("TaskNo", "tblTasksDtls", "TaskID=" & [TaskID]) + 1, 0)

Any suggestions on how to start at 1?

Thanks in advance for your help
 
TaskNo = Nz(DMax("TaskNo", "tblTasksDtls", "TaskID=" & [TaskID]), 0) + 1
 

Users who are viewing this thread

Back
Top Bottom