OPTION GROUP

Jerry14273

New member
Local time
Today, 21:41
Joined
Oct 4, 2001
Messages
5
I have an option group containing four checkboxes. When a user first clicks on a checkbox they now must select one of the four options. The user needs to be able to decide not to have any of the checkboxes selected. I have seen an Access program that allows the user to click on a checkbox (selecting it) then click on it again and it is deselected leaving none of the checkboxes selected. I would like to be able to provide that capability. Can someone explain how or better yet provide code? Thank you.
 
I'll keep an eye on this post. I solved this dilemna by adding one more option to the option group - i.e. "nothing selected".
 
I have posted this problem on four usergroup sites and have not even come close to getting an answer. I know it can be done. I have an Access program (only the exe) and it works great. Click on a checkbox (the check mark appears) click it again the check mark is removed and the option group still works the way it should. Click on box1 then click on box2, box1 is unchecked box2 is checked. Whose know the answer?
 
If you have only an .exe, I can assure you that it is not an Access program since there is NO way to compile an Access database into an .exe file.

The program is either written in VB (the VB option group may work differently) or some other language. You can reproduce the effect in Access by not using an option group at all but instead used an unbound frame and several unbound checkboxes. The reason it is not possible to reproduce this behaviour in an Access option group is because the Click event does not fire when the box that is currently selected is clicked. It only fires if a different option is clicked. To prove this to yourself, do what I did, put a msgbox in each event of the option group so you can see when they fire.

Does this mean that I win the "fur lined P___-Pot" or has someone else supplied a better answer
smile.gif


[This message has been edited by Pat Hartman (edited 10-06-2001).]
 
If you are trying to hide something, all you need to do is create a macro and in the condition make the check yes or no, then the macro would be setvalue, and make it the checkbox visible properties, yes or no
That will hide /unhide it
You also must put the macro on the form (not on the checkbox) in like 2 places like Onload and Oncurrent I think.
Andy
 
Hi there,

On the Double click Event of the Option Group just add the code

me.optiongroupname=0

If you want to open the from with no value clicked in the option group then you set the default value of the Option group to 0.
 
I want to thank everyone that responded. At this point I think the Access program that I have as my example is not using the option group but simulates the option group in VBA code making it possible to accomplish the click on, click off events.
The Double Click solution is the very best if someone wants to go with the option group wizard solution.
Again...Thank you so much for your help.
 
Why can no one see that:

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

will switch a check or option button on or off each time you click it.
The code needs applied to each check/button MouseDown event, not to the group, and if you intend to use the keyboard as well as the mouse, you will have to write some KeyDown event code also.
 

Users who are viewing this thread

Back
Top Bottom