Solved Hide Subreport Page When Printing (1 Viewer)

Juett

Registered User.
Local time
Today, 10:04
Joined
Jul 16, 2019
Messages
71
Hi guys,

I have an issue I'm struggling with.

I have a main report that is made up of subreports. I print / export this main report to a printer or PDF. All works well. Each subreport if effectively one page of the printed main report.

On occasions there is one subreport I want to hide based on a check box contained on another subreport. This also works. The code in the main report's on load event is:

If Me.Child203!Ctl150S.Value = True Then
Me.Child203.Visible = True
Me.Child109.Visible = False
Else
Me.Child203.Visible = False
Me.Child109.Visible = True
End If

However, when I then print the main report, a blank page still gets includes where the now hidden subreport should be / was.

Is there a way to entirely hide / skip this subreport as well as just making it hidden? So the main report skips the blank page entirely when printed?

Thanks very much for your help.
 

Juett

Registered User.
Local time
Today, 10:04
Joined
Jul 16, 2019
Messages
71
Seem to have uncovered my own error.... I was putting the code in the main report's On Load event, but moving it to the main reports On Format event, and setting the Details section to Can Shrink: Yes, and the subreport to Can Shrink: Yes has removed the subreport and blank page it leaves entirely when printed or exported.
 

Users who are viewing this thread

Top Bottom