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

Hiding subreport and its label

Status
Not open for further replies.

WalkieTalkie

Technical User
Feb 15, 2002
91
NZ
I have a report, with a subreport, and I want the subreport to be invisible if it has no data. I followed some earlier threads, tried a few options, and finally found success with the following code:

Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me![srptProfDev].Report![Position]) Then
Me.srptProfDev.Visible = False
Me.srptProfDev_Label.Visible = False

Else
Me.srptProfDev.Visible = True
Me.srptProfDev_Label.Visible = True

End If
End Sub

The subreport becomes invisible, but the trouble is that its bound label doesn't! I have tried deleting the reference to the label altogether, and even tried creating a new, unbound label containing the same text and inserting a reference to that in the code, and still it remains visible! What am I doing wrong?? Any ideas will be appreciated.
Miranda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top