S
sylvian stone
Hi,
I've been trying to figure this problem out without any sucess.
I have a userform within a word document, and the form has about 100
checkboxes and a similar number of ComboBoxes. For example, if a
checkbox is called 'x', the combobox will be called 'x_combo'.
Currently, if I click on 'x', 'x_combo' is enabled, but if 'x' is
unchecked, 'x_combo' is disabled.
The code is below, but with about 100 controls, I need a similar number
of subs to validate each one.
Example:
Private Sub x_Click()
If report.x.value = True Then
report.x_combo.Enabled = True
End If
If report.x.value = False Then
report.x_combo.Enabled = False
End If
End Sub
Now, is it possible to trap a 'click' event and cycle through the
Me.Controls in order to validate each checkbox, and enable / disable
the combobox accordingly ? In fact, I know how I would do the
validation, but what I can't figure out a way to identify the fact that
a checkbox had been checked, without the click() sub being tied to a
specific control, as in the code above.....
Am I trying to do the impossible ?
Rgds
SS.
I've been trying to figure this problem out without any sucess.
I have a userform within a word document, and the form has about 100
checkboxes and a similar number of ComboBoxes. For example, if a
checkbox is called 'x', the combobox will be called 'x_combo'.
Currently, if I click on 'x', 'x_combo' is enabled, but if 'x' is
unchecked, 'x_combo' is disabled.
The code is below, but with about 100 controls, I need a similar number
of subs to validate each one.
Example:
Private Sub x_Click()
If report.x.value = True Then
report.x_combo.Enabled = True
End If
If report.x.value = False Then
report.x_combo.Enabled = False
End If
End Sub
Now, is it possible to trap a 'click' event and cycle through the
Me.Controls in order to validate each checkbox, and enable / disable
the combobox accordingly ? In fact, I know how I would do the
validation, but what I can't figure out a way to identify the fact that
a checkbox had been checked, without the click() sub being tied to a
specific control, as in the code above.....
Am I trying to do the impossible ?
Rgds
SS.