>Is there a way to set the recordsource of a subreport through code?
>I have got a form that I am wanting to use for setting the criteria for a
[quoted text clipped - 9 lines]
>I dont like specifying filters because of some issues with them in reports
>on different PCs.
The place where you can reliably set a report's record
source at runtime is in the report's own Open event.
In the case of a subreport, this can only be done the first
time the subreport appears in the main report. The code to
deal with this is something like:
Sub Report_Open(...
Static Initialized As Boolean
If Not Initialized Then
Me.RecordSource = Forms!theform.newrecordsource
Initialized = True
End If
End Sub

Signature
Marsh
MVP [MS Access]
David W - 13 Dec 2005 19:50 GMT
How would you check to see if a specific form is open, and if it is open,
change the recordsource? I am wanting to change the recordsource to a query
if a specific form is open, and when its not leave it set to a table.
>>Is there a way to set the recordsource of a subreport through code?
>>I have got a form that I am wanting to use for setting the criteria for a
[quoted text clipped - 24 lines]
> End If
> End Sub
Marshall Barton - 14 Dec 2005 00:20 GMT
>How would you check to see if a specific form is open, and if it is open,
>change the recordsource? I am wanting to change the recordsource to a query
>if a specific form is open, and when its not leave it set to a table.
Here's a good way:

Signature
Marsh
MVP [MS Access]
Marshall Barton - 14 Dec 2005 00:22 GMT
>>How would you check to see if a specific form is open, and if it is open,
>>change the recordsource? I am wanting to change the recordsource to a query
>>if a specific form is open, and when its not leave it set to a table.
Whoops.
Here's a good way:
http://www.mvps.org/access/forms/frm0002.htm

Signature
Marsh
MVP [MS Access]