arnelgp
..forever waiting... waiting for jellybean!
- Local time
- Today, 20:02
- Joined
- May 7, 2009
- Messages
- 20,275
you are right, then modify the function, with or without pk this should work.
Code:
Public Function NextSeries() As String
Dim julian As String
Dim c As Variant
julian = Format(DatePart("y", Date), "000")
c = DMax("Len(autoGen) & autoGen", "theTable", "Left(autoGen,3)='" & julian & "'") & ""
If c = "" Then
c = "a"
Else
c = Mid(c, InStr(c, julian))
c = Dec2Alpha(Alpha2Dec(Replace(c, julian, "")) + 1)
End If
NextSeries = julian & c
End Function