Report control: hide blank row when null data

  • Thread starter Thread starter cjborntorun
  • Start date Start date
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.
 
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)) & ...
 
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)) & ...
 
Back
Top