C
CJ
Hi Groupies
The detail section of my report contains a subreport. If the subreport has
no data I do not want the sub or the detail to print. The Visible property
for both the detail and the sub is currently Yes, but I have added the
following code to the Parent Detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
docmd.Echo False
If Me!rsubHoursRemainingOT.Report.HasData Then
Me.Visible = True
Me!rsubHoursRemainingOT.Report.Visible = True
Else
Me.Visible = False
Me!rsubHoursRemainingOT.Report.Visible = False
End If
docmd.Echo True
End Sub
At this point, I still see the detail for every record but the subreport
shows up only when it has data, but I think it would do that anyway even
without the code.
If I set the visible property to No for both, then I don't see anything at
all, so I think that perhaps my code is not in the correct event, but I have
not had any luck anywhere else.
Help Please!!!
CJ
The detail section of my report contains a subreport. If the subreport has
no data I do not want the sub or the detail to print. The Visible property
for both the detail and the sub is currently Yes, but I have added the
following code to the Parent Detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
docmd.Echo False
If Me!rsubHoursRemainingOT.Report.HasData Then
Me.Visible = True
Me!rsubHoursRemainingOT.Report.Visible = True
Else
Me.Visible = False
Me!rsubHoursRemainingOT.Report.Visible = False
End If
docmd.Echo True
End Sub
At this point, I still see the detail for every record but the subreport
shows up only when it has data, but I think it would do that anyway even
without the code.
If I set the visible property to No for both, then I don't see anything at
all, so I think that perhaps my code is not in the correct event, but I have
not had any luck anywhere else.
Help Please!!!
CJ