I have an ID field that is text. Here are some example ID's. The number is generated automatically and the letter is added by the user.
A10565
52073
C20633
RMA18941
I need to start numbering new id's automatically. I don't want to repeat numbers so I need to know which numbers have been used. So I am trying to remove the letters preceeding the numbers. However I can't seem to get rid of the records with more than 1 letter. Here is the what i've tried in the query -
test2: Left([ID],3)
newnum: IIf([test2]="A" Or [test2]="C" Or [test2]="F" Or [test2]="H" Or [test2]="R" Or IIf([test2]="RMA",Mid([ID],4),[ID]),Mid([ID],2),[ID])
after that is run this is what i get -
10565
52073
20633
MA18941
They are fine except the last one - MA18941 needs to be 18941.
I know I am missing something simple
A10565
52073
C20633
RMA18941
I need to start numbering new id's automatically. I don't want to repeat numbers so I need to know which numbers have been used. So I am trying to remove the letters preceeding the numbers. However I can't seem to get rid of the records with more than 1 letter. Here is the what i've tried in the query -
test2: Left([ID],3)
newnum: IIf([test2]="A" Or [test2]="C" Or [test2]="F" Or [test2]="H" Or [test2]="R" Or IIf([test2]="RMA",Mid([ID],4),[ID]),Mid([ID],2),[ID])
after that is run this is what i get -
10565
52073
20633
MA18941
They are fine except the last one - MA18941 needs to be 18941.
I know I am missing something simple