A quick question...

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Just a quick question:

Is it possible to run a procedure on a different form to
the one that's currently in focus?
To be specific:
Form A is open and when users click on a particular
button, Form B opens as well.
When the user then clicks on a particular button on Form
B, certain queries are actioned before Form B is closed
and the focus is returned to Form A. Whilst Form B is
still open (and after the queries have run), I'd like to
be able to ask Form A to run the 'Form_Current' procedure
that's within Form A. Is this possible and if so, how do
I refer to this in code?

Thanks guys (as always),

Lee
 
Lee said:
Just a quick question:

Is it possible to run a procedure on a different form to
the one that's currently in focus?
To be specific:
Form A is open and when users click on a particular
button, Form B opens as well.
When the user then clicks on a particular button on Form
B, certain queries are actioned before Form B is closed
and the focus is returned to Form A. Whilst Form B is
still open (and after the queries have run), I'd like to
be able to ask Form A to run the 'Form_Current' procedure
that's within Form A. Is this possible and if so, how do
I refer to this in code?

Thanks guys (as always),

Lee

This is possible only if you change the keyword "Private" to "Public"
on the definition of the Form_Current procedure in form A. That is,
where it was originally

Private Sub Form_Current()

change it to

Public Sub Form_Current()

Then you can call it by qualifying the procedure name with a reference
to the form in the Forms collection:

Call Forms![Form A].Form_Current
 
I see what you mean. Thanks for the quick response Dirk.

Best Regards,

Lee
-----Original Message-----
Just a quick question:

Is it possible to run a procedure on a different form to
the one that's currently in focus?
To be specific:
Form A is open and when users click on a particular
button, Form B opens as well.
When the user then clicks on a particular button on Form
B, certain queries are actioned before Form B is closed
and the focus is returned to Form A. Whilst Form B is
still open (and after the queries have run), I'd like to
be able to ask Form A to run the 'Form_Current' procedure
that's within Form A. Is this possible and if so, how do
I refer to this in code?

Thanks guys (as always),

Lee

This is possible only if you change the keyword "Private" to "Public"
on the definition of the Form_Current procedure in form A. That is,
where it was originally

Private Sub Form_Current()

change it to

Public Sub Form_Current()

Then you can call it by qualifying the procedure name with a reference
to the form in the Forms collection:

Call Forms![Form A].Form_Current

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
Back
Top