Hiding a Null Field and it's label in a Subreport

K

Krispy

Hi there,
I am trying to get a field and its' label to not be visible on the subreport
if the field is null.

Does anyone know how to do this? Its driving me crazy.
 
J

Jeff Boyce

Open the report in design view.

Click on the control ("fields" are in tables). Open the control's
properties. Find the Can Grow and Can Shrink properties -- and set them
both to Yes.

Click on the section in which the control sits. Set the section's Can Grow
and Can Shrink properties to Yes.

NOTE: if there are any controls in the report that are aligned horizontally
with the control in question, they can "hold open" the control, even if it
has Null.

NOTE2: you don't have to do this on the associated label. You DO have a
label attached to the control, right?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

Krispy

Thank you so much for your quick reply. I love this site!

Your suggestion worked for the control in the detail, but not for the its'
label in the the header.
 
M

Marshall Barton

Add a line of code to the section's Format event:

Me.textbox.Visible = Not IsNull(Me.textbox)
 
K

Krispy

IT WORKS!!!! Thank you. I am doing a dance in my cubicle right now.

Marshall Barton said:
Add a line of code to the section's Format event:

Me.textbox.Visible = Not IsNull(Me.textbox)
--
Marsh
MVP [MS Access]

Thank you so much for your quick reply. I love this site!

Your suggestion worked for the control in the detail, but not for the its'
label in the the header.
 
Top