Modifying autonumber to insert preceding zeroes - Access 2002

  • Thread starter Thread starter Leonard Priestley
  • Start date Start date
L

Leonard Priestley

I am working on a table to hold Capital Expenditure items and would like to
give them ID numbers of the form CAP0000001, CAP0000002, etc. Since I will
be autonumbering the records, I thought of concatenating "CAP" with the
autonumber, but what I really want is to insert leading zeroes to keep the
numbers in the form "CAP" & a seven-digit number. After playing around with
formatting I'm still not able to see how to do this.
Can anyone point me in the right direction please.

Leonard Priestley
 
If all records need the CAP, you can just concatenate that for display
purposes.

The Control Source of the text box would be:
="CAP" & Format([ID], "0000000")
 
Yes, that works beautifully. Thank you for a bit more knowledge.
Have a nice day.

Leonard Priestley

Allen Browne said:
If all records need the CAP, you can just concatenate that for display
purposes.

The Control Source of the text box would be:
="CAP" & Format([ID], "0000000")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Leonard Priestley said:
I am working on a table to hold Capital Expenditure items and would like to
give them ID numbers of the form CAP0000001, CAP0000002, etc. Since I
will
be autonumbering the records, I thought of concatenating "CAP" with the
autonumber, but what I really want is to insert leading zeroes to keep the
numbers in the form "CAP" & a seven-digit number. After playing around
with
formatting I'm still not able to see how to do this.
Can anyone point me in the right direction please.
 

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

Back
Top