Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2005

Tip: Looking for answers? Try searching our database.

Supress dash in zip code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
epete367@optonline.net - 21 Oct 2005 20:28 GMT
I have a report where the zip codes are based on a input mask that
includes the hyphen. When I print 5 digit zip codes the hyphen is
visible. I have tried:
=Trim([ShippingCity] & "," & " " & [ShippingState] & " " &
IIF(Len[ShippingPostalCode]>6,[ShippingPostalCode],Left([ShippingPostalCode],5))
My error may be in my parenthesis but I have not been able to see it.
Any help would be appreciated.
fredg - 21 Oct 2005 20:53 GMT
> I have a report where the zip codes are based on a input mask that
> includes the hyphen. When I print 5 digit zip codes the hyphen is
[quoted text clipped - 3 lines]
> My error may be in my parenthesis but I have not been able to see it.
> Any help would be appreciated.

You use Len() twice but only the second one had the parenthesis.
You can also combine the comma and the space after the
City (& "," & " " &)  into one & ", " &
You need to enclose the =Trim([City] field within it's own set of
parenthesis =Trim([City]) & etc.

Try:
=Trim([ShippingCity]) & ", " & [ShippingState] & " " &
IIF(Len([ShippingPostalCode])>6,[ShippingPostalCode],Left([ShippingPostalCode],5))

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

epete367@optonline.net - 21 Oct 2005 21:26 GMT
Since I posted I have changed to using one control for an address block
to suppress blank lines. It now reads:
=([MailingName]+Chr(13)+Chr(10)) & ([CompanyName]+Chr(13)+Chr(10)) &
([ShippingAddress1]+Chr(13)+Chr(10)) &
([ShippingAddress2]+Chr(13)+Chr(10)) & [ShippingCity] & "," & " " &
[ShippingState] & " " & " " &
IIF(Len([ShippingPostalCode])>6,[ShippingPostalCode],Left([ShippingPostalCode],5))

At this point,  Preview prompts me to 'Enter Parameter Value'
ShippingPostalCode

If, however, I use:
=([MailingName]+Chr(13)+Chr(10)) & ([CompanyName]+Chr(13)+Chr(10)) &
([ShippingAddress1]+Chr(13)+Chr(10)) &
([ShippingAddress2]+Chr(13)+Chr(10)) & [ShippingCity] & "," & " " &
[ShippingState] & " " & " " & [ShippingPostalCode]

everything looks right except for my hyphen.

Thanks for your assistance. I have managed to confuse myself!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.