How to change record source in a report via vba
Posted on 2004-08-31
I have the following question.
I have a report that is suposed to run once for a series of 5 vendors. Right now I have 5 reports; one for each of the 5 vendors. Each report has a query as its record source.
I have rpt_vendor1, rpt_vendor2, rpt_vendor3, rpt_vendor4, and rpt_vendor5 as my report names.
The query names are:
What I would like to do is open a report in design view using a Docmd. After the report is open, I want to be able to change the record source and run the report for each of the 5 vendors, in a loop if possible
I can open the report, but cannot figure out how to change the record source, print the report, change the record source for the next vendor and print the report, etc.
I tried a few things using me! but could not get anything to work.