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?
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?