New England Zip Codes

B

Bob Becker

I live in New England where we have ZIP codes starting with a zero.

I can get the preceding zero to print OK on tables using a 00000 mask,
but when I create labels the preceding zero is deleted.

How can I fix this?

TIA
 
B

Bruce

If the data type is text, you can set the input mask to
Zip Code by using the three dots to the right of that
field in table design view. Does that work for your needs?
 
B

Bob Becker

Bruce said:
If the data type is text, you can set the input mask to
Zip Code by using the three dots to the right of that
field in table design view. Does that work for your needs?

That doesn't appear to work.
I need to have the preceding zero print on labels.

 
D

Duane Hookom

Bruce made a reference to the data being of "text" type. You might not have
an issue if you do this.
 
F

fredg

I live in New England where we have ZIP codes starting with a zero.

I can get the preceding zero to print OK on tables using a 00000 mask,
but when I create labels the preceding zero is deleted.

How can I fix this?

TIA

**Change the datatype of the ZIP field to Text.**
Any field with numbers, which is not going to be used in calculations,
is best saved as a Text datatype.
The leading 0's are saved with the data.

If you are stuck with the number datatype for this ZIP field then
format it in the label's control source:
=[City] & ", " & [State] & " " & Format([ZIP],"00000")
Make sure the name of this control is not "City" or "State" or "ZIP".
 
B

Bob Becker

Duane Hookom said:
Bruce made a reference to the data being of "text" type. You might not have
an issue if you do this.

I did it.
The preceding zero was deleted from the field.
It did not appear.
 
B

Bob Becker

fredg said:
If you are stuck with the number datatype for this ZIP field then
format it in the label's control source:
=[City] & ", " & [State] & " " & Format([ZIP],"00000")

That works!

Thanks, Fred.
 
L

Larry Linson

Convert a number to text using Format to ensure the number of digits:

strZIP = Format(lngZip, "00000")

Numbers are stored as binary in various forms and may have lead zero bits,
but "lead zero characters" are not part of that world.

Larry Linson
Microsoft Access MVP
 

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