WalkieTalkie
Technical User
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
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