View Full Version : Format Control on Auto Numbers


jbeling
12-02-2008, 10:16 AM
I am making a tablethat will require an auto numebr, but i need it to generate in my format:

R00108
R00208
R00308
R00408

As yo can see the number that changes will be the 3 digits between the R and the 08.

How can i do this? I am not too farmiliar with this stuff so forgive me if my newbness is aparent.

Alansidman
12-02-2008, 10:53 AM
In your table, format the autonumber in the properties section at the bottom. "RO"#"08"

Alan

gemma-the-husky
12-02-2008, 12:59 PM
but what you have described isnt an autonumber.

you shouldnt really care what values you have, with an autonumber - they are really there just ot make sure you get non repeating values

eg - in your case
a) what happens if you exceed 99
b) if you start to insert a record, then change your mind, you will lose the autonumber.

so if you want specific numbers, best to use a non-autonumber long, or a string (text) field to store exactly what data you want.

KenHigg
12-02-2008, 01:01 PM
Another option is to store the leading alpha value and concat as required. But your point about bastardized consecutive values would still hold true - :)

jbeling
12-02-2008, 01:03 PM
but what you have described isnt an autonumber.

you shouldnt really care what values you have, with an autonumber - they are really there just ot make sure you get non repeating values

eg - in your case
a) what happens if you exceed 99
b) if you start to insert a record, then change your mind, you will lose the autonumber.

so if you want specific numbers, best to use a non-autonumber long, or a string (text) field to store exactly what data you want.

So, if i want this non auto number to auto populate when i create a new record in my database how do i do that?

Rabbie
12-02-2008, 01:16 PM
Use the MAX or DMAX function to pick up the current highest value of the number and add 1 to it. this way you won't get gaps in the sequence which is always possible if you use an Autonumber.

jbeling
12-04-2008, 11:47 AM
Go it working :) thanks guys!