Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using openargs

Status
Not open for further replies.

ImChard

IS-IT--Management
Jun 17, 2011
6
US
I have a combobox with a list of reports that opens that report when updated. I want to change the source of the report based on the combobox value. I have a table that has the report names and the associated queries in it. Can I use a dlookup to the table in the openargs to set the source to match the report? Or how else best to do this.

My goal is to have one report object and be able to use it for many reports, just changing the source so I can edit the single report object with cosmetic changes.

All the queries have the same field names.
 
Use a global variable.

Set your rowsource to the global variable before opening the report.

On the Reports ON Open Event, set the recordsource property to the global variable.

If you want to pass filters, you need to read the filter before changing the Recordsource and re-specify it after setting the recordsource.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top