Running a module from a command button

  • Thread starter Thread starter Luther
  • Start date Start date
L

Luther

Hi,

I am trying to put a command button on a form to run a
module. I am using the wizard from the tool box, but can't
find the proper function; I see run query, macros,
etc...but no module !!! Can anyone please help me with
this?

Thanks.
 
Luther said:
Hi,

I am trying to put a command button on a form to run a
module. I am using the wizard from the tool box, but can't
find the proper function; I see run query, macros,
etc...but no module !!! Can anyone please help me with
this?

You don't run a module. A module is a container for sub-routines and/or
functions. It is the subs and functions that you "run".

The easiest way to run code from a module is to make it a function and then
you can put...

=FunctionName()

....in the [Event Procedure] property where you want it run. You can also
use [Event Procedure] in the event property and in the event code call the
function or sub.
 
Back
Top