Removing the second line of an address when it is null in an Access 2007 report?

0

I'm trying to use the CanShrink property in a report in Access 2007 so that if the mailingAddress2 field from my query is null or blank it will collapse the Address 2 field and move the mailingCity, mailingState fields up.

All the fields shown are text boxes.

Mailing Address Labels with the field I want to shrink

I read about the CanShrink property and I don't know what else I need to try collapse the field.

leeand00

Posted 2012-12-21T14:43:56.613

Reputation: 14 882

2

There's something here (http://en.allexperts.com/q/Using-MS-Access-1440/2008/1/Shrink-work.htm) that says you have to set the "CanShrink property for the text box AND the section it's in to YES" what's the section detail?

– leeand00 – 2012-12-21T14:51:48.577

Concatenating a space may prevent the field from shrinking. – JeffO – 2013-01-07T19:51:35.050

Answers

0

You can alter your data source (query) to add a new field or just add a text box and apply to the control source property.

Query Field: MailingAddres1and2: IIf(IsNull(MailingAddress1), MailingAddress, MailingAddress & Chr(10) & MailingAddress)

or Control Source of a Text box: =IIf(IsNull(MailingAddress1), MailingAddress, MailingAddress & Chr(10) & MailingAddress)

Chr(10) will insert a carriage return.

JeffO

Posted 2012-12-21T14:43:56.613

Reputation: 272