[AccessD] How to Obtain Access Report Filter information

Stuart McLachlan stuart at lexacorp.com.pg
Sun Jul 24 16:21:17 CDT 2011


str_Report_name = "rpt" & "1"
str_Report_Filter = Reports(str_report_name).Filter 

But you will get an Error 2451 if the report is not open at the time.

-- 
Stuart

On 24 Jul 2011 at 15:39, Brad Marks wrote:

> I am trying to build a VBA routine  to obtain report filter info.
> 
> 
> The following line works nicely to obtain the filter for Report1 and
> store it in a variable called str_Report_Filter
> 
> str_Report_Filter  =  Reports.Report1.Filter
> 
> 
> 
> What I would like to do is make this "Generic" so that I can plug in a
> variable instead of the hardcoded "Report1"
> 
> 
> 
> Something along these lines...
> 
> 
> 
> Dim str_Report_Name
> 
> str_Report_Name = "Report2"
> 
> Is there a way to use a variable in a situation such as this?
> 
> str_Report_Filter = Reports.str_report_name.Filter 
> 
> (I know that this doesn't work. This is just an example of what I am
> trying to do)   
> 
> 
> 
> I have tried many variations and tried to find an example on the
> internet, but have not had any luck.
> 
> A simple example of how to do this would be most appreciated.
> 
> Thanks for your help/advice.
> 
> Brad   
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 






More information about the AccessD mailing list