Hello!
Help me, please, with such problem:
I have usual checkboxes and array of checkboxes on my form.
After attempt to create a common event for control that represents an array I get error:
Form:Object or Class does not support the set of events.
Class clsEventsCode:Option Explicit Private ControlsEvent() As New clsEvents Private Sub Form_Load() Dim i As Long Dim ctl As Control Dim Chk As CheckBox For Each ctl In Me.Controls i = i + 1 ReDim Preserve ControlsEvent(1 To i) Select Case TypeName(ctl) Case "CheckBox" Set Chk = ctl Set ControlsEvent(i).chkBoxInArr = ctl End Select Next ctl End Sub
How to identify that control is a part of array?Code:Option Explicit Public WithEvents chkBoxInArr As CheckBox Private Sub chkBoxInArr_Click() MsgBox "CheckBox has been clicked. Name = " & chkBoxInArr.Caption End Sub
How to access to each control in array in the enumeration to add him to the set of events?




Reply With Quote