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
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
there is NO ERROR checking ( that your job LOL)
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 11:20.
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.