Hi,
I have a report that contains two sub-reports. Depending on user's radio button selection, I want to dynamically change the record source queries for the sub-reports.
I entered this code on the sub-report's Open event.
But I get this run-time error '2191':
"You can't set the Record Source property in print preview or after printing has started."
Please tell me where I need to set the RecordSource property for the sub-reports.
Thanks for your help!!!
SJH
I have a report that contains two sub-reports. Depending on user's radio button selection, I want to dynamically change the record source queries for the sub-reports.
I entered this code on the sub-report's Open event.
Code:
Private Sub Report_Open(Cancel As Integer)
If Forms![myForms]!OptionFrame = 1 Then
Me.RecordSource = "qryCost_Region1"
Else
Me.RecordSource = "qryCost_Region2"
End If
End Sub
But I get this run-time error '2191':
"You can't set the Record Source property in print preview or after printing has started."
Please tell me where I need to set the RecordSource property for the sub-reports.
Thanks for your help!!!
SJH