You could put the subreport into its own section in the main report, and
hide that section if needed. Or you could use the Format event of the Detail
section of the subreport to set the Visible property of the section (or
toggle its PrintSection and MoveLayout properties.)
But a *far* better idea would be to create the source query for this report
with criteria so that these values don't show up.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"ken" <ge****@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hi,
Why can't I do this in the report activate section of my main report?
I have a main report, and a subreport on it. The idea is that if the
subreport has a certain value in a control within it, I want to hide
the subreport. I get an error(runtime 2101 the setting you entered
isn't valid for this property) for the line of code below
Private Sub Report_Activate()
If Reports![Main Report]!Subreport!Value = 0 Then
Me.Subreport.Report.Visible = False
Else
Me.Subreport.Report.Visible = False
End If
End Sub