I have a form with a pushbutton which, when clicked, is to launch a report. I am using the DoCmd.OpenReport method to open the report.
What I want to do is change the report's record source based on data contained in the form. My preference is to set the report's record source property equal to some query string I define using the forms VBA code. I'm willing to set the report's record source to a saved query if I can then modify the saved query from the form's VBA code.
I've made several attempts to edit the reports record source string, but each one has failed for some reason or another (cant find the report, object not defined, etc.).
How can I modify the record source of an existing report? Is there a way to modify the definition of a saved query? Is there a different/better approach to take?
Thanks,
Don
What I want to do is change the report's record source based on data contained in the form. My preference is to set the report's record source property equal to some query string I define using the forms VBA code. I'm willing to set the report's record source to a saved query if I can then modify the saved query from the form's VBA code.
I've made several attempts to edit the reports record source string, but each one has failed for some reason or another (cant find the report, object not defined, etc.).
How can I modify the record source of an existing report? Is there a way to modify the definition of a saved query? Is there a different/better approach to take?
Thanks,
Don