running a cmdbutton_click event from a subform...

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
 
G

Graham Mandeno

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
 
B

Brad Pears

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
 

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