In my project, I have 2 checkboxes in a control array. I have a class that watches for data modified for each of the controls on a passed in form. The code looks similar to the following:

Code:
Private WithEvents m_chkNewCheckbox1 As CheckBox

Private Sub Command1_Click()
    
    Dim ctl As Control
    
    For Each ctl In Controls
        
        If TypeName(ctl) = "CheckBox" Then
            Set m_chkNewCheckbox1 = ctl
        End If
        
    Next ctl
    
    m_chkNewCheckbox1.Value = vbChecked
    
End Sub

Private Sub m_chkNewCheckbox1_Click()
    'Do Something
End Sub
I need the WithEvents in order for the rest of the code to work properly, but I keep getting an error (Run-time error '459': Object or class does not support the set of events). If I take WithEvents out, the code works fine (no errors), but then I can't trap stuff like 'm_chkNewCheckbox1_Click', etc.

Is there any way to make the above code work with control arrays?