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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining muliple fields in a report with additional text 1

Status
Not open for further replies.

Dophia

Technical User
Jul 26, 2004
263
CA
Hi
I have a report which joins the address fields from a query and prints in a report.

The control source of a text box is as follows:

=[QryPoundSheet-a.House_No] & " " & [QryPoundSheet-a.Street_Address] & " " & [QryPoundSheet-a.Street_Suffix] & " " & [QryPoundSheet-a.N/S/E/W] & " " & [QryPoundSheet-a.PO_Box] & " " & [QryPoundSheet-a.City] & " " & [QryPoundSheet-a.Province]

Results in Eg "100 First St N 56 Oshawa ON", where 56 is the box number.

The problem is that when there is a PO Box number in the field, the report shows the PO Box number, but the viewer doesn't know what the number refers to. So, I would like to have "PO Box" appear before the number from the field. But if there isn't a PO Box, then I don't want "PO Box" to appear. Is this possible?

Any guideance would be appreciated.
Sophia (Dophia)
 
Hi Sophia!

Try this:

=[QryPoundSheet-a.House_No] & " " & [QryPoundSheet-a.Street_Address] & " " & [QryPoundSheet-a.Street_Suffix] & " " & [QryPoundSheet-a.N/S/E/W] & " " & IIf(IsNull([QryPoundSheet-a.PO_Box]) = True, [QryPoundSheet-a.PO_Box], "POBox " & [QryPoundSheet-a.PO_Box]) & " " & [QryPoundSheet-a.City] & " " & [QryPoundSheet-a.Province]

hth

Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thank you Jeff! It works perfectly.
Sophia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top