Report control: hide blank row when null data

C

cjborntorun

Hi - I am using what is below in an unbound control on my report. I found
this on another posting on your site. It works great, except one thing: If
I have no "CustomerContactTitle", I would like that row of the address info
to hide on the report, not show a blank line. What am I missing to do that?

=[CustomerName] & Chr(13) & Chr(10) & [CustomerContact] & Chr(13) & Chr(10)
& [CustomerContactTitle] & Chr(13) & Chr(10) & [CustomerAddress1] & Chr(13) &
Chr(10) & ([CustomerAddress2]+(Chr(13) & Chr(10))) & [CustomerCity] & ", " &
[CustomerState] & " " & [CustomerZIP] & " " & [CustomerCountry]


Lastly, I know just enough to be dangerous, but I'm learning.... Can you
tell me, what do the "Chr(13) & Chr(10)" above mean? Seems like one is a
carriage return, but not sure.
 
M

Marshall Barton

cjborntorun said:
Hi - I am using what is below in an unbound control on my report. I found
this on another posting on your site. It works great, except one thing: If
I have no "CustomerContactTitle", I would like that row of the address info
to hide on the report, not show a blank line. What am I missing to do that?

=[CustomerName] & Chr(13) & Chr(10) & [CustomerContact] & Chr(13) & Chr(10)
& [CustomerContactTitle] & Chr(13) & Chr(10) & [CustomerAddress1] & Chr(13) &
Chr(10) & ([CustomerAddress2]+(Chr(13) & Chr(10))) & [CustomerCity] & ", " &
[CustomerState] & " " & [CustomerZIP] & " " & [CustomerCountry]


Lastly, I know just enough to be dangerous, but I'm learning.... Can you
tell me, what do the "Chr(13) & Chr(10)" above mean? Seems like one is a
carriage return, but not sure.

Chr(13) is Carriage Return and Chr(10) is the Line Feed
character. In Access, both are required to start a new line
at the left.

You can use the the difference in how & and + do
concatenation to get your text box the way you want:

.... & ([CustomerContactTitle] + Chr(13) + Chr(10)) & ...
 
C

cjborntorun

THANKS!

Marshall Barton said:
cjborntorun said:
Hi - I am using what is below in an unbound control on my report. I found
this on another posting on your site. It works great, except one thing: If
I have no "CustomerContactTitle", I would like that row of the address info
to hide on the report, not show a blank line. What am I missing to do that?

=[CustomerName] & Chr(13) & Chr(10) & [CustomerContact] & Chr(13) & Chr(10)
& [CustomerContactTitle] & Chr(13) & Chr(10) & [CustomerAddress1] & Chr(13) &
Chr(10) & ([CustomerAddress2]+(Chr(13) & Chr(10))) & [CustomerCity] & ", " &
[CustomerState] & " " & [CustomerZIP] & " " & [CustomerCountry]


Lastly, I know just enough to be dangerous, but I'm learning.... Can you
tell me, what do the "Chr(13) & Chr(10)" above mean? Seems like one is a
carriage return, but not sure.

Chr(13) is Carriage Return and Chr(10) is the Line Feed
character. In Access, both are required to start a new line
at the left.

You can use the the difference in how & and + do
concatenation to get your text box the way you want:

.... & ([CustomerContactTitle] + Chr(13) + Chr(10)) & ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top