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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label boxes are causing my fields to generate unwanted blank lines

Status
Not open for further replies.

mobile2

Programmer
Dec 19, 2002
38
GB
In Access 97 I have created reports from the label wizard based on relevant queries within the same database. The fields, which are address details, appear on the left hand side of my label report and are kept together because the wizard has a built in function that does not generate blank lines if there is a null value. This is great and works fine for me, but now I want to add some standard text, using label boxes, directly opposite the fields inserted by the label wizard. When I try to do this and preview the report the fields generated by the wizard have blank lines in between them which I don't want. Is there another way I can add standard text to the report without interfering with the set-up of the fields on the label wizard. I would be very grateful for any advice or suggestions. Thanks
 
What is happening is that you are introducing a fixed space for your standard text where the label may have a blank or a null. Because your entry is fixed it will negate what the Trim() function is doing in the Address label.
The only way round this would be to put the Standard Text line either above or below the address entry.
 
Another way would be to simulate what the label wizard does. Replace the multiple address text boxes that the wizard created with a single unbound text box to your report (txtAddress) and set it's Can Grow property to Yes.

In the On Format event of the report's detail section, put code similar to this:
Code:
Me.txtAddress = IIf(IsNull([AddressLine1]), "", [AddressLine1] & vbCrLf) & IIf(IsNull([AddressLine2]),  "", [AddressLine2] & vbCrLf) & IIf(IsNull([AddressLine3]),  "", [AddressLine3])
 
Trendsetter
I thought so.

CosmoKramer
I'll give it a bash.

Thank you both for your advice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top