I store different query name in a form combo box, so when open a report the
recordsource can change base on the form combo box.
Gary
If the form is open when you open the report:
Code the report's Open event:
Me.Recordsorce = forms!FormName!ComboName
Alternatively code an event on the form:
DoCmd.OpenReport "ReportName", acViewPreview
reports!ReportName.RecordSource = Me!ComboName
Wouldn't it be easier to just have just one record source, and use the
Where clause argument of the OpenReport method to filter the records?
For example...
DoCmd.OpenReport "ReportName",acViewPreview, , "[CompanyID] = " &
Me[CompanyID
It's simple enough to change the Where clause to whichever field(s)
you want to filter on.