Trigger event with controls in Frame (Vba)

courtney1403

New Member
Joined
Mar 31, 2011
Messages
1
Hello everybody,

I have a problem with Excel 2003 and I need your help.
I use a frame with some controls in it.
I want to creat a trigger event on a checkbox.
When I use an individual control (such as checkbox, button...), I can easily creat a event on it by clicking on it, and it will go to the code:


Private Sub Cmdsearch_Click()


End Sub


But when I use a frame, I can not do that. When I clicked on any control in the frame, it only go to this sub:

Private Sub Frame1_Click()

End Sub


So, I can't make the even on the checkbox.

I tried this code:

Private Sub Frame1_Click()
With Frame1
If .Controls("Checkfy") = True Then
.Controls("Checkmonth").Enabled = False
.Controls("Cmbmonth").Enabled = False
Else
.Controls("Checkmonth").Enabled = True
.Controls("Cmbmonth").Enabled = True
End If
End With
End Sub

But it made me click twices to do the event (once on the checkbox & once on the frame).

Is there a way to make a trigger event on the checkbox like an indivial control?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top