
Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Fred, while setting the RecordSource works for forms, I don't think you will
be able to do that once the report has opened (i.e. any later than
Report_Open.) Likely to get error 2191.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>> I have a form called "frm_report_select" where users make some
>> selections,
[quoted text clipped - 9 lines]
> DoCmd.Close acReport, "ReportName", acSaveYes
> DoCmd.OpenReport "ReportName", acViewPreview
fredg - 03 May 2007 17:40 GMT
> Fred, while setting the RecordSource works for forms, I don't think you will
> be able to do that once the report has opened (i.e. any later than
> Report_Open.) Likely to get error 2191.
Allen,
It does work. Notice that I'm opening it in design view first.
> DoCmd.OpenReport "ReportName", acViewDesign
> Reports!ReportName.Recordsource = "Select blah blah"
> DoCmd.Close acReport, "ReportName", acSaveYes
> DoCmd.OpenReport "ReportName", acViewPreview

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Allen Browne - 03 May 2007 18:21 GMT
Yes of course: I missed the design view.
(I don't do that since it means the app can't be an MDE.)

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>> Fred, while setting the RecordSource works for forms, I don't think you
>> will
[quoted text clipped - 8 lines]
>> DoCmd.Close acReport, "ReportName", acSaveYes
>> DoCmd.OpenReport "ReportName", acViewPreview