Phil said:
Yes, that is exactly correct.
Here's a quickie function I threw together. Testing is up to you.
'----- start of code -----
Function IncrementAlphaNumeric(pValue As String) As String
Dim strValue As String
Dim intDigit As Integer
Dim intCarry As Integer
Dim I As Integer
strValue = UCase(pValue)
If strValue Like "*[!0-9A-Z]*" Then
Err.Raise 5 ' Invalid argument
End If
intCarry = 1 ' initial increment
For I = Len(strValue) To 1 Step -1
If intCarry = 0 Then
Exit For
End If
intDigit = Asc(Mid(strValue, I, 1)) + intCarry
intCarry = 0
Select Case intDigit
Case 58
intDigit = 65
Case 91
intDigit = 48
intCarry = 1
End Select
Mid(strValue, I, 1) = Chr(intDigit)
Next I
IncrementAlphaNumeric = strValue
End Function
'----- end of code -----
Note that the function determines the number of output digits from the
number of input digits, so the input string must be zero-padded on the
left to the full anticipated length.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)