fl****@home.com (Fletcher Arnold) wrote in
<bm**********@hercules.btinternet.com>:
"dchow" <dc***@hotmail.com> wrote in message
news:i2********************************@4ax.com.. . Is it possible to call a subroutine or function whose name is in
a string?
I can't imagine why anyone want might to do this. I have never
felt the need to do so.
I have a standard component in many of my apps that have large
numbers of reports. I call it a "report switchboard," and it
consists of an option group (for type of report), a listbox
(listing the reports for a type) and text field (for the verbose
description of the report). It's driven by a data table.
In that data table, there are three fields that are operated on to
open the report, depending on what type of report it is. Those
fields are:
ReportName
ReportForm
ReportFunction
Only one of these three fields is allowed to be filled out, and the
non-null one gets executed. The code for the first two fields is
quite simple, just DoCmd.OpenReport or DoCmd.OpenForm, but the
latter requires the Eval().
And it's a very useful thing to have for this context.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc