=?Utf-8?B?SW50ZXJhY3RpdmUgd29ya3NoZWV0?=
Hello, wow, lots of responses, thanks a lot for taking an
interest.
This is what i want.
if i started out with 001A and went to 999A the next thing in
sequence will be 001B go all the way through to 999B to 001C so on
and so forth. It will be a long time until it goes through an
alphabet, long enough for me not to worry about it at all. Can
you make that in VBA?
Please let me know and again, thanks a lot.
Alex
Here's a little function that creates an increment of field myID in
table MyTable. You need to add error handling, and customize to your
situation.
public function fNextAlfaID().
dim CurrentID as variant
dim numpart as integer
dim alfaPart as integer
CurrentID = Dmax("myID","MyTable")
If len(currentID) <> 4 then
'bad number. Handle as you see fit
else
numpart = cint(left(CurrentID,3)
alfapart = asc(mid(currentID,4,1))
if numpart < 999 then
numpart = numpart +1
fNextAlfaID = format(numpart,"999" & chr(alfapart)
else
if alfapart < asc("Z") then
numpart = 0
alfapart = alfapart + 1
fnextalfaID = format(numpart,"999" & chr(alfapart)
else
'out of range, handle as you please.
end if
end if
end if
end sub