Mainform code to make one button "click" eight others on Subforms?

  • Thread starter cw via AccessMonster.com
  • Start date
C

cw via AccessMonster.com

I have One Main Form named: frmProjectorControlMasterList

- with eight Subforms named: subfrmControlMaster1 thru subfrmControlMaster8.

- each Subform has two Command buttons, cmdOn & cmdOff.

On the Main Form, I have placed two buttons, cmdAllOn & cmdAllOff.

Question: How do I code the cmdAllOn button, which when clicked, causes each
one of the the subforms' cmdOn buttons to click/run? (With that, I'll make
the cmdAllOff do the same to click the Off buttons.)

Thanks,
cw
 
J

Jeanette Cunningham

Hi cw,
I will describe the details for the first subform.
On the first subform, find the sub for cmdOn and make it Public instead of
Private.

Back on the main form
Private Sub cmdAllOn_Click()
Call Me.subfrmControlMaster1.form.cmdOn_Click
End Sub

Note: If the name of the first subform control is not subfrmControlMaster1,
change the code to the real name of the subform control.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
C

cw via AccessMonster.com

Thanks Jeanette,
I will try that today and respond back with the results.
cw

Jeanette said:
Hi cw,
I will describe the details for the first subform.
On the first subform, find the sub for cmdOn and make it Public instead of
Private.

Back on the main form
Private Sub cmdAllOn_Click()
Call Me.subfrmControlMaster1.form.cmdOn_Click
End Sub

Note: If the name of the first subform control is not subfrmControlMaster1,
change the code to the real name of the subform control.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
I have One Main Form named: frmProjectorControlMasterList
[quoted text clipped - 12 lines]
Thanks,
cw
 

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