View Full Version : Do Not Display If


Just askin
04-27-2007, 02:40 PM
Hello

I have a database which prints a report that has addresses. I have a field "Address1" which may be "Apartment 3B" and a Field "Address 2" which may be "555 Anywhere Street". If "Address 1" is blank how do I get it to not dsiplay a blank line, I want it to only display "Address 2" if "Address 1" is Blank. I would appreciate any advice you can give me.

Just askin

WayneRyan
04-27-2007, 02:51 PM
JA,

Welcome.

Add a new field to your report's query:

NewField: IIF(IsNull([Address 1]), [Address 2], [Address 1] & Chr(10) & Chr(13) & [Address 2])

Your new field will be either:

--> Address Line 2

or

--> Address Line 1
--> Address Line 2

hth,
Wayne

Just askin
04-27-2007, 03:14 PM
Wayne

Thanks for the welcome and the quick reply, I will give it a try and let you know how I did.

Just askin

RuralGuy
04-27-2007, 03:22 PM
You can also set the CanShrink property for the Detail section and that control to YES and see if that gives you an acceptable format. It would depend on the rest of the layout of your report.

Just askin
04-27-2007, 10:05 PM
Wayne
Thanks for all of the advice, got the code to work and it looks good.

Rural
Tried your trick, didn't work, probably the way I have things set-up, but you did inadvertently point me in the right direction, I had to change the "can grow" field on the new field I created.

Thank you both.

Just askin