Incremental Key

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

Guest

I need to create a key field that contains data like this:

NX00001
NX00002
NX00003

How do I set this up so that when I create a new record this is
automatically created in the key field (first column?)
 
If every key will start with "NX", you don't need to store that. You can
use formatting to pre-pend the "NX" in front of each number. And you can
use formatting to turn the number "1" into the string "00001".

To get (guaranteed) sequential numbering, you'll need to create your own
routine (check Google and mvps.org for "Custom Autonumbers"). Do NOT use
the Access Autonumber field, as it is designed to be a unique row
identifier, but may not be sequential).
 
This might sound really dumb, but how do you do this bit?

If every key will start with "NX", you don't need to store that. You can
use formatting to pre-pend the "NX" in front of each number. And you can
use formatting to turn the number "1" into the string "00001".

Thanks again :)
 
Create a query against the table. In the query, format the "IDNumber" field
(a numeric) as something like:
"NX" & Format([YourIDNumberField],00000)
 
Back
Top