W
wellssh
Hello,
I am trying to write the code to increment a number with 2 alpha characters
and a dash in front as follows ES-00001. The number should increment by one
each time the user inputs a new record using the form.
I am using the following code, and it works great when tested on a db
created in A2000. However will not increment at all when using in a db
created in A2003 SP1
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me!Estimate_Number) Then
Me!Estimate_Number = "ES-" & (Format(CLng(Right(Nz(DMax("Estimate_Number",
"Table1"), 0), 5) + 1), "00000"))
End If
End Sub
Is there additional code needed to make it work for A2003?
Thank you in advance
Sherman Wells
I am trying to write the code to increment a number with 2 alpha characters
and a dash in front as follows ES-00001. The number should increment by one
each time the user inputs a new record using the form.
I am using the following code, and it works great when tested on a db
created in A2000. However will not increment at all when using in a db
created in A2003 SP1
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me!Estimate_Number) Then
Me!Estimate_Number = "ES-" & (Format(CLng(Right(Nz(DMax("Estimate_Number",
"Table1"), 0), 5) + 1), "00000"))
End If
End Sub
Is there additional code needed to make it work for A2003?
Thank you in advance
Sherman Wells