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...