Formatting a ZipCode

  • Thread starter Thread starter Margy
  • Start date Start date
M

Margy

Guest
I am having trouble formatting a mailing label zipcode using the xxxxx-xxxx format.

I am using the =Trim([City]&","&[State]&" "&Format([ZipCode],"@@@@@-@@@@")) for Access 2002

My program is Access 1997-is there a different formula and why isn't the above working?

The zipcodes that have an extension come out right but the ones that don't have an extension come out like 6-8894

Any help would be appreciated!
 
Hum...

You may have to do a len() thing to see how long the zip is and format it differently for each of the two cases...
 
Thank you Ken!
The Access manual claims that the @@@@@-@@@@ format should display a sequence of nine numbers with a hyphen properly placed and if there are only 5 numbers then that is all that is displayed. I am doing some small thing wrong and it is driving me crazy!
 
Hum... I would think that it would display fine with having to worry about formatting it... :eek:
 

Users who are viewing this thread

Back
Top Bottom