Hello all
I have an Access 365 report that contains 3 subreports. I would like to make one of the subreports visible, only if it contains data.
My plan was to use a control that contains a count of records in this subreport. If that count is zero, then set visibility of the subreport to false.
The subreport is called "NegConsentOutp utAccounts_subr eport"
The control with the record count is "text45" in the main report (placeholder while I work this out)
I thought I could get away with something as simple as:
But apparently not. Triggering the report yields no visible action. No error message. Removing/commenting the code and the report is generated as expected.
I verified that the text45 control is variable. I get the same non-result whether the value is zero or non-zero.
Thanks in advance for any assistance.
SC
I have an Access 365 report that contains 3 subreports. I would like to make one of the subreports visible, only if it contains data.
My plan was to use a control that contains a count of records in this subreport. If that count is zero, then set visibility of the subreport to false.
The subreport is called "NegConsentOutp utAccounts_subr eport"
The control with the record count is "text45" in the main report (placeholder while I work this out)
I thought I could get away with something as simple as:
Code:
Private Sub Report_Open(Cancel As Integer) If Me.Text45 = 0 Then Me.NegConsentOutputAnnuity_subreport.Visible = False Else Me.NegConsentOutputAnnuity_subreport.Visible = True End If End Sub
I verified that the text45 control is variable. I get the same non-result whether the value is zero or non-zero.
Thanks in advance for any assistance.
SC
Comment