Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Labels not aligned when Can Grow/Shrink enabled 1

Status
Not open for further replies.

TrekBiker

Technical User
Nov 26, 2010
330
GB
When creating address labels I wanted to shrink or grow data fields in a label report depending whether they have data. This is for neatness so there aren't empty lines.

This example has a Company Name field of zero height under LabelName, that can grow.

Label_1_j6vkap.jpg


When running the report the label size also changes as indicated by the bottom line. This isn't acceptable for printing, as below.

Label_2_o11bnm.jpg


If I turn off Can Grow/Shrink the labels appear correctly, but with the blank address lines. How do I fix this?
 
I expect your detail section allows growing. Set it to no and see if your issue is resolved.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Thanks Duane, this occurred to me too but both its Grow and Shrink properties are set to No.

 
Where is the line? If it’s a control in the detail section, it will be pushed down. If you need the line in the same position you could try put it into a group footer or use the Line method in VBA to draw it.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
You can also use one text box with an expression including carriage returns etc.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
The line was only there as a diagnostic to get an idea where the bottom of the label was.

I like the idea of the single text box with carriage returns to control the layout when there are empty lines in an address. I'll give that a try.

Thanks again.
 
I would get rid of the line and temporarily set the background color to yellow. If you set the detail section to not grow, it won’t grow.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
I created a text box in the label report as you suggested, and used this as Control Source

Code:
=(IIf([LabelName] Is Not Null,(Chr(13) & Chr(10) & [LabelName]),Null)) & (IIf([CompanyName] Is Not Null,(Chr(13) & Chr(10) & [CompanyName]),Null)) & (IIf([Address1] Is Not Null,(Chr(13) & Chr(10) & [Address1]),Null)) & (IIf([Address2] Is Not Null,(Chr(13) & Chr(10) & [Address2]),Null)) & (IIf([Town] Is Not Null,(Chr(13) & Chr(10) & [Town]),Null)) & (IIf([County] Is Not Null, [County] & “, “ &),Null)) & (IIf([PostalCode] Is Not Null, [“ “ &PostalCode],Null))

This worked a treat, thank you Duane.

I have a supplementary question about selecting addresses by first digits of the postcode, entered in the underlying query criteria. I'm using one query first to pick one of several customer types and then want the selection to be made on just these. I'm getting no results. I'll start a new thread for this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top