Hi All
I have a very large collection of reports serving as template letters for different scenarios, which I want to update to use a new record source query returning different fields. To do this I would need to update the record source for each report and for each of the relevant fields within it and it seems to me that it should be possible to set up a sub that could do this for me and which I pass the names of the various reports to. Unfortunately I'm falling at the first hurdle:
Docmd.OpenReport ("MyReport")
Reports![MyReport].Report.ControlSource = "NewQuery"
...results in Run Time Error '2465': application defined or object defined error
Usually I can get there in the end with these things if I search the internet, particularly this site, enough, but I'm drawing a bit of a blank here. Is my method completely wrong?
I have a very large collection of reports serving as template letters for different scenarios, which I want to update to use a new record source query returning different fields. To do this I would need to update the record source for each report and for each of the relevant fields within it and it seems to me that it should be possible to set up a sub that could do this for me and which I pass the names of the various reports to. Unfortunately I'm falling at the first hurdle:
Docmd.OpenReport ("MyReport")
Reports![MyReport].Report.ControlSource = "NewQuery"
...results in Run Time Error '2465': application defined or object defined error
Usually I can get there in the end with these things if I search the internet, particularly this site, enough, but I'm drawing a bit of a blank here. Is my method completely wrong?