module calling another module

S

SharonInGa

First, do I have my terms right? Is this called a module?

Private Sub cboRestartReports_Click()

2nd, how do I call one module from another module? I want
to go to: Private Sub cmdRunAllRpts_Click() after I click
on Private Sub cboRestartReports_Click(.
 
S

Stewart Tanner

hi Sharon,

it's called a procedure. The procedures live in a module.
in your cboRestartReports_Click event put
call cmdRunAllRpts_Click
 
J

John Vinson

First, do I have my terms right? Is this called a module?

Private Sub cboRestartReports_Click()

Not really. A "Module" is a block of text containing zero, one, or
many Procedures and/or Declarations. The line you quote would be *in*
a module, but it's the first line of a Procedure (a subroutine
procedure to be precise).
2nd, how do I call one module from another module? I want
to go to: Private Sub cmdRunAllRpts_Click() after I click
on Private Sub cboRestartReports_Click(.

You don't call a Module (the container) - instead, you call a
Procedure. A line at the appropriate place in cboRestartReports_Click
such as

Call cmdRunAllRpts_Click

would do what you want.

One comment: if cboRestartReports is a combo box, you may want to
reconsider using its Click event; perhaps the AfterUpdate event (which
fires when the user has selected a line in the combo) would be more
appropriate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top