jazminecat
Programmer
Hi all - I've tried a few approaches to this, and it seems I"m almost there, but I'm stuck. I have a report, with the recordsource of a query called Subrecipient.
I have a form called RunQuery with an option group that allows the user to check either subrecipient, (first option) or contracts (Second option).
the button the form opens the report.
In the on open event of the form I have the following code, which doesn't seem to be working to change the recordsource of the report:
Basically I want to change the query that the report is based on depending on what is selected on that form.
I know I can't change the recordsource of a report that's not open, which is why I put this code in the on open event of the form.
but the debug.print shows me the recordsource always stays the same - it stays as subrecipientreport no matter what.
Hope someone can help,
thanks!!
I have a form called RunQuery with an option group that allows the user to check either subrecipient, (first option) or contracts (Second option).
the button the form opens the report.
In the on open event of the form I have the following code, which doesn't seem to be working to change the recordsource of the report:
Code:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms!RunQuery!Frame15
Case 1 'subrecipients
Case Is = 0
Me.RecordSource = Queries!SubrecipientReport
Case 2 'contracts
Case Is = 1
Me.RecordSource = Queries!ContractReport
End Select
Debug.Print Me.RecordSource
End Sub
Basically I want to change the query that the report is based on depending on what is selected on that form.
I know I can't change the recordsource of a report that's not open, which is why I put this code in the on open event of the form.
but the debug.print shows me the recordsource always stays the same - it stays as subrecipientreport no matter what.
Hope someone can help,
thanks!!