running a Sub in a class module from a functionin a general module

P

Paul

If I have a sub in the module for a form named frmActivity which contains a
procedure named

Sub cmd_close_form_Click()

is there a way to call that Sub and run the procedure from a function in a
general module?

Thanks in advance,

Paul
 
D

Dirk Goldgar

Paul said:
If I have a sub in the module for a form named frmActivity which contains
a procedure named

Sub cmd_close_form_Click()

is there a way to call that Sub and run the procedure from a function in a
general module?


Only if:

(a) the form is open, and
(b) the declaration of the Sub is changed to:

Public Sub cmd_close_form_Click()

If those two criteria are met, then you can call the Sub via a reference to
the form:

Call Forms!frmActivity.cmd_close_form_Click
 
P

Paul

Works great.

Thanks, Dirk.


Dirk Goldgar said:
Only if:

(a) the form is open, and
(b) the declaration of the Sub is changed to:

Public Sub cmd_close_form_Click()

If those two criteria are met, then you can call the Sub via a reference
to the form:

Call Forms!frmActivity.cmd_close_form_Click


--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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