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.

Problem with address format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
epete367@optonline.net - 31 Oct 2005 21:51 GMT
I am using the following:
=([ShippingName]+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))

for a shipping address. The problem is if the fields are blank I still
end up with a comma (,) showing.
At times shipping address is blank if it is the same as mailing
address. How can I hide the unnecessary comma?
Thank you!
John Spencer - 31 Oct 2005 22:14 GMT
Continue using the + for concatenation vice the &

=([ShippingName]+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))

I also don't understand the reason for the IIF statement.  The way I read it
is says
If shipping Postal code is more than 6 characters then print the entire
shipping code
If shipping Postal code is 5 or less characters, then print all the shipping
postal code up to the 5 characters.

>I am using the following:
> =([ShippingName]+Chr(13)+Chr(10)) & ([CompanyName]+Chr(13)+Chr(10)) &
[quoted text clipped - 8 lines]
> address. How can I hide the unnecessary comma?
> Thank you!
epete367@optonline.net - 31 Oct 2005 22:23 GMT
The reason for the IIf statement lies in the underlying form & table. I
used an input mask for the postal code. If I do not use the IIf
statement if the postal code has 5 digits it prints xxxxx- By using the
IIf statement if the postal code has 5 digits I now get xxxxx while if
there are 9 digits I get xxxxx-xxxx.
 
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.