Unanswered: auto-incrementing numbers with text prefixes in Access 2007
Firstly let me appologise if this has been asked before (I've tried searching and not yet found anything I can use )
My boss has asked me to automatically generate a number for leads that get entered into our DB via a form.
The problem is that these numbers need to be prefixed with either an AG or BG (depending on which of our 2 offices the lead relates to). Selecting A or B is easy enough but what I need help with is some code to find the highest number with the selected prefix and give the new record that number + 1.
For example you may have a table with these lead numbers:
If I were to add a new record relating to the AG office I want the code to see that AG7 is the current highest number and call my new record AG8.
Once that number has been generated I want it (including the prefix) stored in a field for that record (if possible I'd like this to be the primary key as all values will be unique).
I hope that makes sense, please ask if you need any more info.
Probably you are using Windows WinZip's better to use older versions of unzip program. My colleague @Sinndho spoke about this in a previous post. The sign of my post you link my website and you can download it from the instance.
I introduced you to the table Office is an identification label OfficeID
Table Document is identified DocumentID field to be built in such a way as to select a tag as Office and with the same label in the table document ID field incremental increases. The moment you change the label ID OfficeID counter continues to count on that kind of office.