Creating Field With combo of autonumber and text

B

Benjamin

Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!
 
K

KARL DEWEY

If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.
 
B

Benjamin

Thank you! But where do I put that formula in? And what does the "4" represent?



KARL DEWEY said:
If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.

--
Build a little, test a little.


Benjamin said:
Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!
 
K

KARL DEWEY

where do I put that formula
In the queries that feed your forms or reports.
Numbers do not have leading zeros. This adds zeros but because the number
of digits is unknown the process takes the right 4 characters after putting
zeros in front of the number.

--
Build a little, test a little.


Benjamin said:
Thank you! But where do I put that formula in? And what does the "4" represent?



KARL DEWEY said:
If the prefix is ALWAYS the same then use the autonumber like this --
MyID: "CCA" & Right("000" & [AutonumberField], 4)

Bear in mind that an autonumber field may skip a number or more in sequence.

--
Build a little, test a little.


Benjamin said:
Hello,

I'm looking to create a field that has both an autonumber component and a
static text portion. So, instead of having as an ID# the simple autonumber
function of 1,2,3 etc., I want to have it generated to be something like:
CCA0001, CCA0002...CCA0135 etc.

Any ideas? Thanks!
 

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