B
BruceM
I have a form on which are two check boxes (bound to Yes/No fields) that
cannot both be the same value. Under some circumstances neither will be
checked, so I don't think I can use an option group unless I add a third
option, which I don't want to do.
I know I can add this to one check box (and the inverse to the other):
Private Sub Check1_AfterUpdate()
Me.Check2 = Not Me.Check1
End Sub
However, I would like to know if I could handle both check boxes from a
single function (or sub), or otherwise streamline the process. The code
above, if placed in a function and called from the After Update event,
affects one check box differently than the other. I could write an If
statement to take care of both check boxes, but I wouldn't be saving myself
much coding.
My actual situation involves several pairs of check boxes, and other cases
in which a similar principle applies. It comes up often enough that I would
like to know if there is a way to handle it more efficiently.
cannot both be the same value. Under some circumstances neither will be
checked, so I don't think I can use an option group unless I add a third
option, which I don't want to do.
I know I can add this to one check box (and the inverse to the other):
Private Sub Check1_AfterUpdate()
Me.Check2 = Not Me.Check1
End Sub
However, I would like to know if I could handle both check boxes from a
single function (or sub), or otherwise streamline the process. The code
above, if placed in a function and called from the After Update event,
affects one check box differently than the other. I could write an If
statement to take care of both check boxes, but I wouldn't be saving myself
much coding.
My actual situation involves several pairs of check boxes, and other cases
in which a similar principle applies. It comes up often enough that I would
like to know if there is a way to handle it more efficiently.