creating unique reference numbersusing lettersand numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a unique refernce for documents relating to various projects.

Each project has a prefix madeup of 3 letters eg AMW, MOB.

I then want to create a sequential number refernce for each set of letters eg

AMV1, AMV2, MOB1, MOB2

Can this be done and if so what is the easiest way to do it?

Thanks in advance
 
Wow! This question hasn't been asked for over a week.
It is done using the DMax function.
I would suggest you use two fields for this. One text field for the prefix
and one Long Integer for the sequential number. Trust me on this, I have
been on the other side of the argument and have since been conviced it is the
better way.

lngNextNum = Nz(DMax("[DocRefNum]", "DocsTable", "[DocRefPrefix] = '" _
& strPrefixToFind & "'"), 0) + 1
 
Back
Top