DaveyEdgar
Technical User
Greetings all!
I have a main report with a sub report. The sub report is linked to the main report. The sub report contains a "violations" control/field. I'd like that sub report to only display records that contain 'callout' in the "violations" control/field.
The underlying query for the subreport underlies other forms, so I can't change the query itself. I really don't want to create yet another query, so I'm hoping there is an easy way to filter that subreport.
I tried this in the main report...
...but I get an error saying I used an invalid reference or something.
Is there an easier way?
I have a main report with a sub report. The sub report is linked to the main report. The sub report contains a "violations" control/field. I'd like that sub report to only display records that contain 'callout' in the "violations" control/field.
The underlying query for the subreport underlies other forms, so I can't change the query itself. I really don't want to create yet another query, so I'm hoping there is an easy way to filter that subreport.
I tried this in the main report...
Code:
Private Sub Report_Open(Cancel As Integer)
Reports![rptrona]![rptRONAsubdis].Form.RecordSource = "Select * from [qrydiscipline] WHERE [violation] = 'callout' "
End Sub
Is there an easier way?