Here a Mark 1 verson should point you down the right track Should get your thinking hat going
we need to use the CHR() and ASC()
Chr(number) return the letter
Asc(Letter) return the number
So here the code
there is NO ERROR checking ( that your job LOL)
Dim firstbit As String
Dim secpit As String
firstbit = UCase(Left(ThisCode, 1))
secpit = UCase(Right(ThisCode, 1))
newsecbit = Chr(Asc(secpit) + 1)
If newsecbit = "[" Then ' we have pass "Z"
firstbit = Chr(Asc(firstbit) + 1)
newsecbit = Chr(Asc("A")) ' only did this so it look like the line above
Next_Code = firstbit & newsecbit
you need to put a Stop
if you pass "ZZ" you get "[A"
cope code into module save it
then to get the next code pass the current code
New_Code = Next_Code("AA")
New_Code = "AB"
in query just go
Last edited by myle; 05-23-12 at 10:20.
hope this help
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
THEY'RE BEHIND YOU FOR A REASON