strID = CurrentDb.OpenRecordset(F).OpenRecordset.Fields("ID")
strID = Trim(strID) 'trim off invisible spaces
Dim oInvSuffix As String
If Len(strID) = 1 Then
oInvSuffix = "00" & strID
ElseIf Len(strID) = 2 Then
oInvSuffix = "0" & strID
ElseIf Len(strID) = 3 Then
oInvSuffix = strID
End If
Dim arrASCII() As Byte
arrASCII = StrConv(strID, vbFromUnicode)
The array should contain the ASCII codes for all the characters in ID.
Dim rs as DAO.REcordset
set rs = currentdb.Openrecordset(F)
strID = rs!ID
But if your ID field is a string, is there a chance that you could have some unicode characters in there which are not displaying?For intLoop = 1 to Len(strID)
debug.print mid(strID, intLoop, 1), ASC(mid(strID, intLoop, 1))
Next
strID = CurrentDb.OpenRecordset(F).OpenRecordset.Fields("ID")
strID = Trim(strID) 'trim off invisible spaces
But based on a bit of testing, its clear that strID is NOT declared as a string, because if it was, then the code would work as originally intended. It must be declared as an integer (Which btw, I wouldn't recommend. Use long for any ID, to avoid integer overflow)
strID = Trim(Cstr(strID)) 'trim off invisible spaces