what is the path/code for letting a sub click a cmdbutton on the main form?

Insomnia

Registered User.
Local time
Today, 22:48
Joined
Oct 9, 2004
Messages
30
I have read a guide but still can't make it work. I have a control in the sub, from which I wish to run a control on the main form.
 
Forms!MainFormName.ControlName_Click

Make sure the mainform button's click event is public, not private.
 
damnit, it was private, nowonder it didn't work! thanks m8,

/Insomnia
 
G’day Insomnia and Paul.

Me.Parent.ControlName_Click

Is slightly shorter but also avoids hard coding the parent form name.

That way you won’t need to alter the code if the parent form name is changed or if the sub form is used in more than one place.

Hope that helps.

Regards,
Chris.
 

Users who are viewing this thread

Back
Top Bottom