Hi,
When you are referencing an Access object (form, report) etc. in a code module outside the object you are referencing, I understand that you have to reference it explicitly - reports!rptMyReport etc. What I am wondering is this, can you pass a report name as a variable to this explicit reference?
Here's the scoop. I am using a form to filter an open report. I got the info from the Knowledge Base. The code in the form explicitly references a particular report. The issue is, I want to be able to use 1 Filter form for 10 different reports and not have 10 different forms. I am currently housing the information for the form in a table and am populating it depending on which report you want to see. But the code fails when it hits the Reports!MyRpt variable stating that MyRpt cannot be found in the Reports collection. MyRpt is the variable (Dim MyRpt as String) that holds the report name. But I cannot figure out how to pass the report name as a variable. Any Ideas??
Lee
When you are referencing an Access object (form, report) etc. in a code module outside the object you are referencing, I understand that you have to reference it explicitly - reports!rptMyReport etc. What I am wondering is this, can you pass a report name as a variable to this explicit reference?
Here's the scoop. I am using a form to filter an open report. I got the info from the Knowledge Base. The code in the form explicitly references a particular report. The issue is, I want to be able to use 1 Filter form for 10 different reports and not have 10 different forms. I am currently housing the information for the form in a table and am populating it depending on which report you want to see. But the code fails when it hits the Reports!MyRpt variable stating that MyRpt cannot be found in the Reports collection. MyRpt is the variable (Dim MyRpt as String) that holds the report name. But I cannot figure out how to pass the report name as a variable. Any Ideas??
Lee