I have an ID field that I would like to start with the letter A and increments by 1.
A, B, C....Z then next AA, AB, AC....AZ all the way to ZZ.
Thanks!
I have an ID field that I would like to start with the letter A and increments by 1.
A, B, C....Z then next AA, AB, AC....AZ all the way to ZZ.
Thanks!
Probably not easy. First query the table to find the max value then convert the ASCII characters to decimal, increment, then convert back to alpha.
ASC("A") = 65
ASC("B") = 66
ASC("a") = 97
Chr(97) = "a"
However:
ASC("AA") = 65
ASC("AB") = 65
Get it? Parse the string and get decimal value of each part, increment value(s) and concatenate back to alpha:
Chr(65) & Chr(67) = "AC"
Why do you want this?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Forgot to mention that I'm new at this. Don't know VBA.
Just got curious if there was a simple way to not use the autonumber, rather to create a custom ID field.
No, it is not simple. Custom unique ID is common topic. Search forum and Google.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ok, thanks!