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

Arthur Fuller fuller.artful at gmail.com
Fri Jan 27 19:33:43 CST 2012


Ok, I get your point. I would suggest that you pursue your chosen path and
add a table housing these report names, along with an appropriate
Autonumber PK. Then, however you choose to select the appropriate report
(UI, code, whatever) you can grab the name of the report and pass it into
your generic call. That approach would eliminate all if If clauses and keep
the code to about 3 lines. You'd pay a small penalty in performance, but it
would be almost endlessly flexible.


On Fri, Jan 27, 2012 at 8:13 PM, Brad Marks <BradM at blackforestltd.com>wrote:

> Arthur,
>
> Sorry, I should have explained earlier in more detail what I am trying to
> do.
>
> I am building an Access 2007 "Reporting" application.
>
> I have written a number of small chunks of VBA code to support "Compound
> Dynamic Report Filters".  Much of the code is "Common" code, but some of
> the code needs to be customized slightly for each Report.
>
> In the "common" code that calls the "Specialized" code, I current use IF
> statements to call the proper sub.  This will require one IF statement for
> each report (someday we might have 50+ reports)
>
> By being able to use a variable in the VBA CALL statement, we will be able
> to have just a few lines of code, instead of all the code needed to support
> 50+ different reports.
>
> I hope that this explains what we are trying to do.
>
> Also, I am still learning about Access and I often ask questions and do
> experiments just to learn new things.
>
> The folks here on AccessD have been wonderful with their help and
> suggestions.
>
> Brad
> --

Arthur
Cell: 647.710.1314

The most difficult thing to understand about the universe is that the
universe is understandable.
-- Albert E.


More information about the AccessD mailing list