creating unique reference numbersusing lettersand numbers

J

janeasharp

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
 
K

Klatuu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top