OPTION GROUP!!!

Jerry14273

New member
Local time
Today, 10:02
Joined
Oct 4, 2001
Messages
5
I have asked the multitudes and no one has an answer. I hope you can solve this one. I have an option group (created with the wizard) and it has four checkboxes. As you know once one of the checkboxes are selected it is impossible to unselect it except by selecting one of the other three. I need to be able to unselect the selected one so that none of them are selected (the user made an error and didn't mean to select any of them). I have an Access program (only the exe) that performs this feat very nicely and need to know how it is done. TIA
 
Are you positive that it is an Option Group and not just four checkboxes that have attached code that makes them behave like an Option Group?

[This message has been edited by Jack Cowley (edited 10-06-2001).]
 
I assume you have the default value for the Option Group Frame set to 0 (zero) so all chkboxes are unchecked by default when on a new record.

To unselect any choice made by the user, add a small cmdButton inside the frame or somewhere near so the user knows what it does. Use the On Click event of cmdbutton to clear the choice. Here is an example of the code needed with the button:

Private Sub cmdButtonName_Click()
Me.YourFrameControlName = 0
End Sub

(change "cmdButtonName" and "YourFrameControlName" to the actual names of your controls)

HTH
RDH

[This message has been edited by R. Hicks (edited 10-06-2001).]
 
Jack & R.Hicks,
Thank you for your replys. Jack, after posting this question on numerous sites I have yet to get an answer to the question. I think that you are right...I don't think the program is using the option group. If anyone things differently please let all of us know.
 
It must not be an option group or my reply would work. If you can zip the db and email a copy to me I'll be glad to take a look. Include all details of where the problem is.

ricky@athree.com

HTH
RDH

[This message has been edited by R. Hicks (edited 10-06-2001).]
 
You could put something like this on the MouseDown (and maybe also KeyDown) events of each check box to reverse the value each time you click it.

Private Sub Check15_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Me!Check15.OptionValue = 1 Then Me!Check15.OptionValue = 0 Else Me!Check15.OptionValue = 1
End Sub

Seems to work fine for me!
 

Users who are viewing this thread

Back
Top Bottom