Line spacing on report, eliminate blanks?

pungentSapling

NeedHotSauce?
Local time
Today, 18:25
Joined
Apr 4, 2002
Messages
116
I have an address section on a report. I would like to know a way to make any txtboxes that are empty not take up a line in the report.

example: if the [address2] field is empty I would like the next field [City] to be directly under [address1] rather than have an empty line seperating [address1] and [City]

I thought about moving all of the fields inside one txtbox....this could eliminate the spacing problem, but then I need a way to force a line break. I don't know one.(though I am sure there must be a simple way)

so my question is two pronged.....
a: how do I suppress an empty control on a report?
b:how do I force a line break in a txtBox?


thanks in advance
p
 
Simplistic but not the best.

I am sure that someone else has a much better way of doing this, but here is what I have done in the past.

Put all your fields on the report as you would like to see them.
Make sure they all are set to grow.
Decrease each text boxes height so the text box looks like a line.
Put each text box "line" as close to each other as possible.

This way, if there is text in the field, the field will grow to the heigth of the text. If it is null (empty), it will not take up any room on the report.

The only problem with this is when you want to make changes to the fields, since they are the heigth of a line they are hard to find at times.

Like I said, some one else will probably have a better solution but this will get you started until they jump in. I know there is a way to specify the placement on the report of a text field with code.
 
thanks a bunch.... that will work for now and I would not have thought of it.

ps I accidentally posted this message in the wrong area....meant to put it in reports... sorry folks
p
 
well, that kind of worked......but as you said it is not ideal. I think waht I want is a sub that checks if the field is null and then makes its height = to 0 if null....but this still does not move all the other controls up to take up the space of the empty control
 
Can't address the first issue, but ...

Me.txtBoxFinal = Me.txtBox1 & vbCrLf & Me.txtBox2

hth,
Wayne
 
WayneRyan - Thanks for adding that. I learned something new today.

pungentSapling - I have been searching for code to move the text boxes to specific locations on the reports, but have not had very good luck. Hope WayneRyan's reply helps you. I think I might rework some of my reports.
 
=[FirstName] & " " & [LastName] & Chr(13) & Chr(10) & [Address] & Chr(13) & Chr(10) & IIf(IsNull([City]),"",[City] & Chr(13) & Chr(10)) & [PostalCode]
 

Users who are viewing this thread

Back
Top Bottom