[AccessD] How to Obtain Access Report Filter information

Brad Marks BradM at blackforestltd.com
Sun Jul 24 16:52:43 CDT 2011


Stuart,

Thank you for the help, I really appreciate it.

Your example works nicely for what I am trying to accomplish.

Brad




-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart
McLachlan
Sent: Sunday, July 24, 2011 4:21 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to Obtain Access Report Filter information

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
> 



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.





More information about the AccessD mailing list