Not printing empty controls?

T

Tony Williams

I have a report thank includes 4 lines of address. Some people have only 3
lines. Is there anyway that on the report the controls that don't have data
are shrunk to eliminate spaces? I have ticked Can Shrink but this doesn't
seem to work.
Thanks
Tony
 
R

Rick B

Yes, normalize your data ;-)

If your people have one or more addresses, then you should store the
addresses in a separate related table. A person with one address would have
one entry in that table. A person with five addresses would have five
records in that table...


tblPersonData
RefNumber
FirstName
MiddleName
LastName
HomePhone
CellPhone
etc.


tblAddresses
RefNumber
AddressType (home, work, mailing, etc.)
Address1
Address2
City
State
Zip
 
T

Tony Williams

Rick Thanks sorry obviously didn't explain properly
Everyone has only one address but some have 3 lines in the address some have
4 I have 5 controls on the report
txtadd1,txtadd2,txtadd3,txtadd4 and txtpostcode
If someone has only 3 lines then txtadd4 is empty but I don't want an empty
line in my report between txtadd3 and txtpostcode.
Is that better?
Thanks
Tony
 
D

Duane Hookom

Setting the control's Can Shrink property to Yes will shrink controls if
their values are Null. If there are controls to the left or right of the
"can shrink" text boxes, you won't notice any difference.

If you are not getting the expected "can shrink" results then you are not
telling us some significant information about your report layout or the
control source values of your text boxes. You might want to temporarily set
the border of your "can shrink" text boxes to red to see what's happening.
 
R

Rick B

Ah. Then use the shrink and grow properties.

One way is to squish all the controls down to one pixel in height, then set
them to "can grow" and put them one under the other.

You couls also put them all in one unbound field and include carriage
returns if the fields contain data. Something like...

=[txtadd1]+(& chr(13) & chr(10)) & [txtadd2]+(& chr(13) & chr(10)) &
[txtadd3]+(& chr(13) & chr(10))& [City] & ", " & [State] & " " [ZIP]
 
T

Tony Williams

Thanks guys I'll try those two suggestions tomorrow I'm in the Uk and its
18.30 so packing in for the day to get some food. Will try tomorrow
Thanks again
Tony
 
T

Tony Williams

Just to say I've solved it with your help. There was a control along side
the address controls, when I moved it to below the address it worked fine
Thanks
Tony
 
Top