Re: Cheak boxes .value help
It means that you are in an infinite loop in that one of your changes to a value causes another to be changed which causes the original to be changed, etc.
Re: Cheak boxes .value help
Looking at your requirements closely shows that they are contradictory.
The first two basically say that the value of chkExtension must be the same as the value of chkSpecialEvent, while the next two contradict that.
Re: Cheak boxes .value help
if chkSpecialEvent is on, then chkExtension must be on
chkExtension can be on while chkSpecialEvent is off
but if chkSpecialEvent is tured off then chkExtension must be tured off at the same time
does that make more sence?
Re: Cheak boxes .value help
Make use of the third possible State (vbGrayed) for the Value property and disable chkExtension when chkSpecialEvent is checked.
Try this code to see if it gives you the functionality you want.
VB Code:
Private Sub chkExtension_Click()
If chkExtension.Value = vbChecked Then
chkSpecialEvent.Value = vbUnchecked
End If
End Sub
Private Sub chkSpecialEvent_Click()
If chkSpecialEvent.Value = vbChecked Then
chkExtension.Value = vbGrayed
chkExtension.Enabled = False
Else
chkExtension.Value = vbUnchecked
chkExtension.Enabled = True
End If
End Sub
If you don't want to disable chkExtension use this code.
VB Code:
Private Sub chkExtension_Click()
If chkExtension.Value = vbChecked Then
chkSpecialEvent.Value = vbUnchecked
ElseIf chkSpecialEvent.Value = vbChecked Then
chkExtension.Value = vbGrayed
End If
End Sub
Private Sub chkSpecialEvent_Click()
If chkSpecialEvent.Value = vbChecked Then
chkExtension.Value = vbGrayed
Else
chkExtension.Value = vbUnchecked
End If
End Sub
Re: Cheak boxes .value help
reply, thanks a lot, yes that did give me what i wanted. thanks a lot.
do you think the user would think they can't click the icon while its greyed?
Re: Cheak boxes .value help
Usually when a control is greyed it means it is disabled, computer users I think have this general thought...