click on any control triggers event
click on any control triggers event
(OP)
I have many checkboxes on a form. If the user clicks on any one of them, I want to trigger an event (displaying a picture if the value is True). Is there a way to do this without having a procedure for each control?
Private Sub cbx1_Click()
End Sub
thru
Private Sub cbx30_Click()
End Sub
Private Sub cbx1_Click()
End Sub
thru
Private Sub cbx30_Click()
End Sub





RE: click on any control triggers event
Maybe this will trigger something for you..
RE: click on any control triggers event
The form has:
MouseDown, MouseUp and Click
The Chkbox has:
the same plus KeyDown, Keypress and Keyup
You should be able to trap on those
Good Luck
RE: click on any control triggers event
CODE
If Left(a.Name, 5) = "Check" Then
If a.Object.Value = True Then
MsgBox a.Name & " is checked"
End If
End If
Next
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376: Eng-Tips.com Forum Policies before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: click on any control triggers event
RE: click on any control triggers event
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376: Eng-Tips.com Forum Policies before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: click on any control triggers event
The example code is set up for CommandButtons but you can change it to work with CheckBox controls.
Hope this helps.
Regards,
Mike
RE: click on any control triggers event