Hi,
I am trying to disable option button (OptionButtonDropsH) if check box (CheckBoxDrops) is not selected. It works if I "check" and then "uncheck" the check box, but when the form opens initially, the option box is still enabled and can be chosen. My code is below:
Private Sub CheckBoxDrops_Click()
If CheckBoxDrops Then
OptionButtonDropsH.Enabled = True
Me.lblDropsH.Enabled = True
Else
If Not CheckBoxDrops Then
OptionButtonDropsH.Enabled = False
Me.lblDropsH.Enabled = False
End If
End If
End Sub
Any suggestions?
I tried adding something like below before the code above, but it did not work:
Private Sub txtActivity_Click()
Dim objCtrl As Control
For Each objCtrl In Me.Controls
If objCtrl.ControlType = acOptionButton Then
objCtrl.Enabled = False
End If
End If
Next
End Sub
Thanks a lot in advance!
P
Bookmarks