Calling Subform Procedure from MainForm

A

Al Campagna

Hello all,
I origianlly posted this question on the Forms NG, but it appears as
though it's slipping down the list without a response.

Is it possible to call a Subform Event Procedure 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 Refresh, however, I need to call
that SubForm Procedure from the Mainform.

I've used the Lebans code in the past, with good results, but I've always
"called" the code from within the subform itself.

If it's possible to call this subform procedure (RequeryTheSubform) from
the MainForm, and what would the syntax
be?

Thanks in advance,
Alan Camp
 
R

Ron Weiner

From the Sub Form Make the Sub/Function Public as in Public Sub MySub()

From the Parent

Call Me.sfrmChildName.Form.MySub

Ron W
 
A

Al Campagna

Thanks Ron,
I knew it was do-able, but couldn't find any info on the syntax to "call"
it.
I'll try that out.
Thanks,
Al Campagna
Candia, NH
 

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