Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating zip code in label wizard

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
I am using the label wizard report to create labels from a query. However, I just realized that the zip code on those with the last 4 digits do not have the dash between the first group and the second. Is there any easy way to correct this problem.

Thanks in advance

PS: I'm new a this and am still learning.
 
pwise,

My input mask on the table is as follows:
00000\-9999

I used the same format for the report input mask, but I think because the program is using a trim feature it is not formating correctly. This is what it says on my control source line:
=Trim([City] & ", " & [State] & " " & [Zip])

This is something the wizard automatically put in.
 
Either never use input masks, write an expression to add the dash if the length of Zip >5 or write a small function.

Try something like:
=[City] & ", " & [State] & " " & IIf(Len([zip])<=5,[zip],Left([Zip],5) & "-" & Mid([zip],6))

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top