Format Autonumber Data Type (1 Viewer)

irunergoiam

Registered User.
Local time
Today, 05:22
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.
 

irunergoiam

Registered User.
Local time
Today, 05:22
Joined
May 30, 2009
Messages
76
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?
 

Mr. B

"Doctor Access"
Local time
Today, 08:22
Joined
May 20, 2009
Messages
1,932
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.
 

Fisher31

Registered User.
Local time
Today, 14:22
Joined
Oct 7, 2009
Messages
11
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
 

boblarson

Smeghead
Local time
Today, 06:22
Joined
Jan 12, 2001
Messages
32,059
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

Top Bottom