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 "NegConsentOutputAccounts_subreport"
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:
Expand|Select|Wrap|Line Numbers
- 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