i want to code vba on to my check box such that when box 1 is checked, then the user would be unable to check box 2 or vice versa. does anyone know how i can code this? thank you for your help.
From the OnClicked even of the box being clicked, you can do the following:
if me.YourCheckboxName.Value = true then
me.YourOtherCheckboxName.Enabled = false
else
me.YourOtherCheckboxName.Enabled = true
end if.
Do the same for your other check box only reversing the control names...
There are more elegant ways of doing this, but this is just a quick suggestion petersdaniel@hotmail.com
"If A equals success, then the formula is: A=X+Y+Z. X is work. Y is play. Z is keep your mouth shut." --Albert Einstein
Another option would be to use an option group. If you put your check boxes in an option group then Access will make sure only one at a time will be selected. A couple of things you will need to know:
Access will not keep other options from being selected, it will only make sure that one is selected at any time.
The option group's value will be the option value of the selected check box. This is how you determine in code which check box is selected.
That too... petersdaniel@hotmail.com
"If A equals success, then the formula is: A=X+Y+Z. X is work. Y is play. Z is keep your mouth shut." --Albert Einstein
Actual, the CUA standards for check-boxes in an option group type of control call for none, one or more being "check-able". If you really want just ONE option in a group to be usable, you should use RADIO BUTTONS instead. Just a thought...
Jim There are two ways to argue with a woman - neither one works.
Another free Access forum:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.