[AccessD] Is it Possible to Have a Variable in a VBA "CALL"Statement?

Brad Marks BradM at blackforestltd.com
Mon Jan 30 16:30:05 CST 2012


Ken,

Thanks for the ideas, I appreciate it.

Brad

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth
Ismert
Sent: Monday, January 30, 2012 11:04 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Is it Possible to Have a Variable in a VBA
"CALL"Statement?

Brad,

One thought: have code behind each report that sets up your custom
filtering. Use a standard public method name.

Then, use CallByName to setup the report:

    CallByName(Reports("name"), "SetupFilter", VbMethod)

This way, the filter code that is specific to a report stays with that
report.

I used to be much more of a purist in VBA, but I got spoiled by
languages
like JavaScript that support functional programming. See:

Can Your Programming Language Do This?
http://www.joelonsoftware.com/items/2006/08/01.html

So, I think your approach fine. Big nested If or Case statements should
be
avoided, especially if they must be touched every time a new report is
added.

-Ken
-- 
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