Incremental Key

M

MJFrog

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?)
 
J

Jeff Boyce

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).
 
M

MJFrog

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 :)
 
J

Jeff Boyce

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

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