Clicking a button in a main form from its subform

PuddinPie

Registered User.
Local time
Today, 05:12
Joined
Sep 15, 2010
Messages
149
Hello,

I'm trying to figure out how to click a button in a main form from one of it's subforms. I know how to do it the opisite way going form a main from to a subform but not from a subform to a main form.

Any ideas?
 
Hello,

I'm trying to figure out how to click a button in a main form from one of it's subforms. I know how to do it the opisite way going form a main from to a subform but not from a subform to a main form.

Any ideas?

I'm not quite sure I understand exactly what you are trying to achieve :confused: Are you wanting to fire the code behind the On Click event of the button without actually clicking that button or something else :confused:
 
Make a Public procedure in the main form module.

Refer to that from the subform module as:

Me.Parent.Form.ProcedureName

Generally I recommend public procedures (ie a Method of the Form) to be on their own and to be called by both the button they normally work from and the outside procedure. However this is not essential so you can refer directly to the On Click procedure if you prefer.

Me.Parent.Form.ButtonName_Click
 

Users who are viewing this thread

Back
Top Bottom