Preceding Zeros with Concatenation

G

Guest

I have 3 different fields in my table, one is a 2 digit number field, one is
a 3 digit autonumber that starts at 001, and the last is a 2 character text
field. I need to concatenate these along with some special characters
example: 04-001-AH to show up on my form. My problem is I can't get the
autonumber field to show the preceding zeros in the concatenation. I
formatted it on it's own in my table as 000 but with the concatenation it
just goes back to not showing the preceding zeros.
 
A

Allen Browne

Use the Format function around the number field.

The Control Source of the text box will be something like this:
=[Field1] & Format([Field2], "\-000\-") & [Field3]
 
G

Guest

Thank you Duane!!!

Duane Hookom said:
Use the format() function
& Format([YourField],"000")

--
Duane Hookom
MS Access MVP


lilbomshl said:
I have 3 different fields in my table, one is a 2 digit number field, one is
a 3 digit autonumber that starts at 001, and the last is a 2 character text
field. I need to concatenate these along with some special characters
example: 04-001-AH to show up on my form. My problem is I can't get the
autonumber field to show the preceding zeros in the concatenation. I
formatted it on it's own in my table as 000 but with the concatenation it
just goes back to not showing the preceding zeros.
 
G

Guest

Thank you Allen!!!

Allen Browne said:
Use the Format function around the number field.

The Control Source of the text box will be something like this:
=[Field1] & Format([Field2], "\-000\-") & [Field3]

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

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

lilbomshl said:
I have 3 different fields in my table, one is a 2 digit number field, one
is
a 3 digit autonumber that starts at 001, and the last is a 2 character
text
field. I need to concatenate these along with some special characters
example: 04-001-AH to show up on my form. My problem is I can't get
the
autonumber field to show the preceding zeros in the concatenation. I
formatted it on it's own in my table as 000 but with the concatenation it
just goes back to not showing the preceding zeros.
 

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