I have this code below to generate custom numbers
Private Sub Address_AfterUpdate()
Dim cw1
If NewRecord Then
cw1 = Nz(Right(DMax("[Reference]", "Table1"), 3))
Me.Reference = "HPS" & Format(cw1 + 1, "000")
End If
End Sub
but when it reached 1000, it wont add any further, it just keeps repeating 1000.
Iv tried to change the 3 after the table1 to 4 no use and change the 3 zeros to four no use.
any help please
Private Sub Address_AfterUpdate()
Dim cw1
If NewRecord Then
cw1 = Nz(Right(DMax("[Reference]", "Table1"), 3))
Me.Reference = "HPS" & Format(cw1 + 1, "000")
End If
End Sub
but when it reached 1000, it wont add any further, it just keeps repeating 1000.
Iv tried to change the 3 after the table1 to 4 no use and change the 3 zeros to four no use.
any help please