removing blank lines on labels

G

Guest

I have set up an address label report using the label wizard. I have all the
text boxes set to YES for Can Shrink and Can Grow, but I am still getting
blank lines when say there is no Company Name in the address. Is there
another way to remove them?

Thanks,
Vickie
 
G

Guest

Hi Vickie.

Do you have any overlapping controls? Overlapping controls can't grow or
shrink.

Also, from Access Help:
Sections grow and shrink vertically across their entire width. For example,
suppose a form has two text boxes side by side in a section, and each control
has its CanShrink property set to Yes. If one text box contains one line of
data and the other text box contains two lines of data, both text boxes will
be two lines long because the section is sized across its entire width.

-Michael
 
K

Ken Snell \(MVP\)

Assuming that no company name means that field contains a Null, you can use
the fact that Nulls propagate through + operations to remove the blank line.
Use an expression similar to this for the report's textbox that contains the
address info:

=[NameOfPersonField] & (Chr(13) + Chr(10) + [NameOfCompanyField]) & Chr(13)
& Chr(10) & [AddressLine1Field] & [AddressLine2Field] & Chr(13) & Chr(10) &
[CityField] & ", " & [StateField] & " " & [ZipField]


With the above expression, if the NameOfCompanyField contains a Null, no new
line will be started for the company information.
 
G

Guest

Thank you both, Micheal and Ken,

Boy do I feel sheepish. I had "spaces" in the textboxes. My kindergarden
teacher husband pointed it out to me. So embarressed. ; )

Thanks for the tips though. I probably will use them someday.

Vickie

Ken Snell (MVP) said:
Assuming that no company name means that field contains a Null, you can use
the fact that Nulls propagate through + operations to remove the blank line.
Use an expression similar to this for the report's textbox that contains the
address info:

=[NameOfPersonField] & (Chr(13) + Chr(10) + [NameOfCompanyField]) & Chr(13)
& Chr(10) & [AddressLine1Field] & [AddressLine2Field] & Chr(13) & Chr(10) &
[CityField] & ", " & [StateField] & " " & [ZipField]


With the above expression, if the NameOfCompanyField contains a Null, no new
line will be started for the company information.
--

Ken Snell
<MS ACCESS MVP>

vlh said:
I have set up an address label report using the label wizard. I have all
the
text boxes set to YES for Can Shrink and Can Grow, but I am still getting
blank lines when say there is no Company Name in the address. Is there
another way to remove them?

Thanks,
Vickie
 
G

Guest

=IIf(IsNull([Contact1stName] & " " & [ContactSurname]),"",[Contact1stName] &
" " & [ContactSurname] & Chr(13)) & Chr(10)
& IIf(IsNull([Address1]),"",[Address1] & Chr(13)) & Chr(10)
& IIf(IsNull([Address2]),"",[Address2] & Chr(13) & Chr(10)
& IIf(IsNull([Address3]),"",[Address3] & Chr(13) & Chr(10))
& IIf(IsNull([Address4]),"",[Address4] & Chr(13) & Chr(10)
& IIf(IsNull([Address5]),"",[Address5] & Chr(13) & Chr(10))))


Note the number of )))) at the end of the address

Also note that this is NOT the same code as used in Word which is {} (
press control F9) which does much the same task.



Hope this helps

--
Wayne
Manchester, England.



vlh said:
Thank you both, Micheal and Ken,

Boy do I feel sheepish. I had "spaces" in the textboxes. My kindergarden
teacher husband pointed it out to me. So embarressed. ; )

Thanks for the tips though. I probably will use them someday.

Vickie

Ken Snell (MVP) said:
Assuming that no company name means that field contains a Null, you can use
the fact that Nulls propagate through + operations to remove the blank line.
Use an expression similar to this for the report's textbox that contains the
address info:

=[NameOfPersonField] & (Chr(13) + Chr(10) + [NameOfCompanyField]) & Chr(13)
& Chr(10) & [AddressLine1Field] & [AddressLine2Field] & Chr(13) & Chr(10) &
[CityField] & ", " & [StateField] & " " & [ZipField]


With the above expression, if the NameOfCompanyField contains a Null, no new
line will be started for the company information.
--

Ken Snell
<MS ACCESS MVP>

vlh said:
I have set up an address label report using the label wizard. I have all
the
text boxes set to YES for Can Shrink and Can Grow, but I am still getting
blank lines when say there is no Company Name in the address. Is there
another way to remove them?

Thanks,
Vickie
 

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