Converted Macro Question

R

Ray S.

I created a macro to run a report from a form. The form allows selection of
information from combo boxes that consists of variable criteria for a query
that is the data source for the report. The whole thing works rather nicely.
I then analyzed the performance of my macro from the datasheet tools menu. It
suggested that I convert the macro to visual basic, instructing me to save
the macro as a module. I did so. It appears to have no errors. So, what am I
supposed to do with that module? Do I somehow now replace the original macro?
I've read about calling the procedure from another macro now, but isn't that
a bit redundant? Any help in clarifying this subject is greatly appreciated...
 
D

Dirk Goldgar

Ray S. said:
I created a macro to run a report from a form. The form allows
selection of information from combo boxes that consists of variable
criteria for a query that is the data source for the report. The
whole thing works rather nicely. I then analyzed the performance of
my macro from the datasheet tools menu. It suggested that I convert
the macro to visual basic, instructing me to save the macro as a
module. I did so. It appears to have no errors. So, what am I
supposed to do with that module? Do I somehow now replace the
original macro? I've read about calling the procedure from another
macro now, but isn't that a bit redundant? Any help in clarifying
this subject is greatly appreciated...

Although I've only converted a macro to a module once -- because I
normally write VBA procedures instead of macros -- I believe the
converter will have created a function with the same name as the
original macro, and stored it in a module with that name prefixed by
"Converted Macro - " or something like that. You'll want to call this
function wherever you formerly called the macro. So where was that? If
it was in an event property of an object (such as a form, report, or
control), then you can replace the name of the macro in that property
with a function expression that calls the function. For example, of
your macro was named "RunMyReport", then where the property was formerly

RunMyReport

now it would be

=RunMyReport()
 
Top