B
BobV
Group:
I have a form with three checkboxes on it and an OK button. I want the user
to be able to select either one, two, or three checkboxes. Then when the OK
button is pressed, some code will be executed that will vary depending if
one, two or all three of the checkboxes have been checked. The checkboxes
are not in an Option Group on the form; they are simply on the form. I did
not put them in an Option Group because it only allows one box to be checked
at a time. I am using the code below to set a variable when a checkbox has
been clicked.
Private Sub FedCheckBox_Click()
ApplyFed=1
En Sub
Private Sub StateCheckBox_Click()
ApplyState=1
En Sub
Private Sub BookCheckBox_Click()
ApplyBook=1
En Sub
My question is how do I toggle the variable between 1 and 0 if the user
checks a box and then decides to uncheck the same box? Do I use a different
event to trap this situation? What event would that be. Or what code do I
need to have behind the above Click events to accomplish this?
Your help will be greatly appreciated.
Thanks,
BobV
I have a form with three checkboxes on it and an OK button. I want the user
to be able to select either one, two, or three checkboxes. Then when the OK
button is pressed, some code will be executed that will vary depending if
one, two or all three of the checkboxes have been checked. The checkboxes
are not in an Option Group on the form; they are simply on the form. I did
not put them in an Option Group because it only allows one box to be checked
at a time. I am using the code below to set a variable when a checkbox has
been clicked.
Private Sub FedCheckBox_Click()
ApplyFed=1
En Sub
Private Sub StateCheckBox_Click()
ApplyState=1
En Sub
Private Sub BookCheckBox_Click()
ApplyBook=1
En Sub
My question is how do I toggle the variable between 1 and 0 if the user
checks a box and then decides to uncheck the same box? Do I use a different
event to trap this situation? What event would that be. Or what code do I
need to have behind the above Click events to accomplish this?
Your help will be greatly appreciated.
Thanks,
BobV