Public Function basIncrAlphN(strAlphN As String) As String
'Michael Red. 12/21/2002
'To Create an Incrementing A-N field with rollover
'AAA01 to AAA99
'AAB01 to AAB99
Dim Idx As Integer
Dim MyChr As String * 1
Dim MyValStr As String
Dim MyStrStr As String
Dim MyValVal As Long
'Easy on me, make user supply the last value. "I" don't know where it is
For Idx = 1 To Len(strAlphN)
MyChr = Mid(strAlphN, Idx, 1)
If (IsNumeric(MyChr)) Then
MyValStr = MyValStr & MyChr
Else
MyStrStr = MyStrStr & MyChr
End If
Next Idx
MyValVal = CLng(MyValStr) + 1
If (MyValVal = 100) Then
'Do The Rollover
MyValVal = 1
'Incr the String Part
'Just put each char into Seperate Char
MyStrStr = basIncrStr(MyStrStr)
End If
basIncrAlphN = MyStrStr & right("00" & Trim(str(MyValVal)), 2)
End Function