Format Autonumber Data Type

irunergoiam

Registered User.
Local time
Today, 14:32
Joined
May 30, 2009
Messages
76
I would like to use the autonumber data type (with New Values selected as Random) to create a unique identifier for temporary staff. There are two changes I wish to make to this number:

1) limit the length of the random number to numeric characters (the default is 10.
2) add a "t" prefix to distinguish this number for "temporary" staff. Is there another way other than concantenating in a query?

Thanks much for any guidance you guys might offer.
 
In my haste to post, I neglected a few details:

1) limit the length of the random number to 6 numeric characters (the default is 10).
2) add a "t" prefix to distinguish this number for "temporary" staff. Is there another way other than concantenating in a query?
 
You will have to generate this type of value on your own as Access does not provide any way to modify or format the AutoNumber type field.
 
I am trying to do something simular (with the prefix letter) and I found a simple way of doing this by entering say "T"000 into the caption box in the field properties in the table design veiw.

I hope this makes sense
 
To both irunergoiam and Fisher31 -

Do not use autonumbers for meaningful purposes. You WILL get burned at some point. Autonumbers are guaranteed to give you a UNIQUE number. They are not guaranteed to go in consecutive order (even if you do have that property set) and they are not guaranteed to always be positive numbers. Autonumbers should really only be used for "behind-the-scenes" stuff. If you have need of a specific number with meaning, use a different method (the DMax + 1 for example).
 

Users who are viewing this thread

Back
Top Bottom