Calling Sub from Main form

  • Thread starter Thread starter Al Campagna
  • Start date Start date
A

Al Campagna

Hello all,
Is it possible to call a Subform Event Procedure in a subform, from the
Main form.

"Example" names:
frmMyMainForm
frmMySubForm - Contains an event procedure called Private Sub
RequeryTheSubform.

I am using some Lebans code in the subform that will prevent the subform
from "jumping up" while doing a Requery or Refresh, however, I need to call
that SubForm Procedure from the Mainform.
I've used this code in the past, with good results, but I've always
"called" the code from within the subform.

If it's possible to call this sub from the MainForm what would the syntax
be?

Thanks in advance,

Alan Camp
 
Al Campagna said:
Is it possible to call a Subform Event Procedure in a subform, from the
Main form.

"Example" names:
frmMyMainForm
frmMySubForm - Contains an event procedure called Private Sub
RequeryTheSubform.

I am using some Lebans code in the subform that will prevent the subform
from "jumping up" while doing a Requery or Refresh, however, I need to call
that SubForm Procedure from the Mainform.
I've used this code in the past, with good results, but I've always
"called" the code from within the subform.

If it's possible to call this sub from the MainForm what would the syntax
be?

Alan,

you must change the Sub from Private to Public. Then I guess you can
call it like this:

Call Me![MySubformControlOnMainForm].Form.RequeryTheSubform

Best regards
Emilia

Emilia Maxim
PC-SoftwareService, Stuttgart
http://www.maxim-software-service.de
 
Back
Top