running a cmdbutton_click event from a subform...

  • Thread starter Thread starter Brad Pears
  • Start date Start date
B

Brad Pears

I want to run the click event of a particular command button on the main
form - when I am on a subform.

I tried the following syntax but it does not work...

forms![frmMain].CommandButton_Click

Any ideas?

Thanks,

Brad
 
Hi Brad

In the declaration of the CommandButton_Click procedure, change "Private" to
"Public".

Then you can call it directly from the subform via its Parent property:
Call Me.Parent.CommandButton_Click
 
Excellent!! Thanks for your help...

Graham Mandeno said:
Hi Brad

In the declaration of the CommandButton_Click procedure, change "Private"
to "Public".

Then you can call it directly from the subform via its Parent property:
Call Me.Parent.CommandButton_Click
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Brad Pears said:
I want to run the click event of a particular command button on the main
form - when I am on a subform.

I tried the following syntax but it does not work...

forms![frmMain].CommandButton_Click

Any ideas?

Thanks,

Brad
 
Back
Top