Calling Sub from Main form

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
 
E

Emilia Maxim

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
 

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