Calling an event on main form from a subform

A

arm

Hi! Could anyone please help me how to call an event on main form from a
subform. Thanks.
 
A

Allen Browne

Remove the word "Private" from the event procedure you wish to call. For
example change:
Private Sub Button1_Click()
to:
Sub Button1_Click()

Then from the subform:
Call Me.Parent.Button1_Click


Another alternative, assuming the main form is named "Form1":
Call Form_Form1.Button1_Click
 

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