M
Mike
In my database I have a report with a subreport (“repSubRepâ€) in one of the
main report group header. I would like the subreport to be visible only if
the value of a certain text box (“PLSGroupID“) in the group header is equal
to 9:
Private Sub MainLevelHeader_Format(Cancel As Integer, FormatCount As Integer)
If Me.PLSGroupID = 9 Then
Me.repSubRep.Report.Visible = True
Else
Me.repSubRep.Report.Visible = False
End If
End Sub
The above code works fine. But in spite of that the subreport is not visible
in most of the grops, the recordsource query of the subreport runs every time
while formatting the MainLevelHeader which slows the report preview process
dramatically.
Is it possible to make something so that the recordsource query of the
subreport would run ONLY when the subreport is visible?
Thank you in advance for any tips!
main report group header. I would like the subreport to be visible only if
the value of a certain text box (“PLSGroupID“) in the group header is equal
to 9:
Private Sub MainLevelHeader_Format(Cancel As Integer, FormatCount As Integer)
If Me.PLSGroupID = 9 Then
Me.repSubRep.Report.Visible = True
Else
Me.repSubRep.Report.Visible = False
End If
End Sub
The above code works fine. But in spite of that the subreport is not visible
in most of the grops, the recordsource query of the subreport runs every time
while formatting the MainLevelHeader which slows the report preview process
dramatically.
Is it possible to make something so that the recordsource query of the
subreport would run ONLY when the subreport is visible?
Thank you in advance for any tips!