totn Access

MS Access 2003: Suppress blank lines on a report

This MSAccess tutorial explains how to suppress blank lines on a report in Access 2003 (with screenshots and step-by-step instructions).

Question: In Microsoft Access 2003/XP/2000/97, I'm trying to create a report where there are two address lines, but the second address line may not have a value. For example:

Jo Jon
Help desk Ste. 100     (this is address 1)
P O Box 200            (this is address 2)
EL Paso, tx, 79999

For the person above, there is a second address. But for this next person there is none.

Jay Jones
Help desk Ste. 100     (this is address 1)
                       (this is address 2)
EL Paso, tx, 79999

My question is how do I set up the report so that it doesn't print out spaces in address 2? Like this for example:

Jay Jones
Help desk Ste. 100     (this is address 1)
EL Paso, tx, 79999

Answer: Let's look at a report to demonstrate.

Microsoft Access

In our report, we've got an Address1 field and an Address 2 field as described above.

When we run our report, it looks as follows:

Microsoft Access

As you can see, there is a blank line between "Help desk Ste.100" and "El Paso, tx, 79999" for "Jay Jones".

To prevent Access from printing this blank line when there is no value in Address2, you need to set the "Can Shrink" property on the Address2 field to "Yes.

Microsoft Access

Now when we run our report, the blank line no longer appears when Address2 does not contain a value.

Microsoft Access

Important: Our only caution when using the "Can Shrink" property is to make sure that the field that you are shrinking does not overlap with any other field (either a physical overlap or another field that has the same "Top/Height" range). If there is an overlap, Access will not shrink the field as desired.