Generate next number that starts with a letter

  • Thread starter Thread starter AnnieJ
  • Start date Start date
A

AnnieJ

I have a field with despatch note numbers, each number starts with a D, e.g.
D1234,D1235,etc. I want to generate the next available number, ie Dxxxx + 1.
I have tried and failed with DMax, I know this works with only numbers but
get an error when there is a letter. Is it possible to generate next number
while ignoring the D?
Thanks
 
You need to remove the letter D from the front (then add it back on:

"D" & CLng(Mid(Nz(DMax("[NameOfField]", "[NameOfTable"), "D0"), 2)) + 1
 
Back
Top