I have an app that creates a report essentially comprised of three sections. The user has the ability via a simple yes/no setting in the apps properties settings to suppress the third section. In doing so, the typical report only requires a single page, whereas if all three sections are included the report flows to a second page.
In the OnActivate event of the report the code looks up the setting that stipulates the inclusion or exclusion of the 3rd section. When the 3rd section is to be excluded, the OnActivate code calls the Sub "SuppressResv" which, as you can see, toggles the visibility of the controls for the 3rd section.
So what's the problem you ask? The report still un-necessarily produces a second page. While I'm not surprised that the "white space" is still preserved for the invisible controls, the question becomes how to suppress the controls and effectively release the space they would otherwise occupy if visible. I could have two versions of the report but that kind of duplication is normally ill advised.
Are there any methods other than the "SuppressResv" to accomplish what I'm asking? Maybe put the controls in a sub-report and either include or exclude the sub-report?
Code:
Private Sub SuppressResv()
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' Display of reserved accounts are to be suppressed. Just hide all the
' controls.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Me.PB2.Visible = False
Me.Ln2.Visible = False
Me.lblRA1.Visible = False
Me.Child29.Visible = False
Me.lblRA2.Visible = False
Me.tbRAB30.Visible = False
Me.lblBottomLine.Visible = False
Me.tbB3.Visible = False
Me.lbl28.Visible = False
Me.tbRAB3.Visible = False
Me.Line26.Visible = False
Me.tbTotal3.Visible = False
End Sub