I'm having issues with an onclick event for a checkbox in a vba form. Basically what I am trying to do is ammend the value of all checkboxes on specific tab to be the same value as a master checkbox. In this instance, it is the 'Use Online' captioned checkbox below (online_toggle in the code) which once clicked should toggle the other checkboxes on the tab 'on' or 'off'. I currently have the following code but it keeps producing an error at 'For Each obj In online.OLEObjects'
Private Sub online_toggle_Click()
Dim ctl As Control
For Each ctl In Me.MultiPage1.Pages(6).Controls
If TypeOf ctl Is MSForms.CheckBox Then
If ctl.GroupName = "online_variants" Then
If ctl.Name <> "online_toggle" Then
ctl.Value = online_toggle.Value
End If
End If
End If
Next ctl
End Sub
N.B. online is the name of the tab on which all of the checkboxes are situated. If it helps the checkboxes affected by the master checkbox are all grouped as online_variants
Cheers,
Jason