Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Groups

Status
Not open for further replies.

Prufrock

Instructor
Sep 4, 2002
77
AU
Hi a quick query I hope. I have an option group because I only want one of 3 choices selected. However if someone clicks in there by mistake and then does not want to make any choice they can't remove the tick by clicking again. Is there a way to remove the tick when accidentally selected? In some cases people do not need to make any selection and it is those who accidentally make a choice then realise they want to remove it I need to cater for.
 
You need to set the value of the Option Group's Frame to Null. You could do this with a "reset" button, or by clicking on the option group frame itself, using code like this:

Code:
Private Sub ResetOptionGroup_Click()
 Me.YourOGFrame = Null
End Sub

or

Code:
Private Sub YourOGFrame_Click()
 Me.YourOGFrame = Null
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I tried the Frame Approach and it simply locked me out of ticking at all. I just need to allow them to remove the tick if they make a mistake. I want however the idea that you have to have an option if intentionally click in there and choose 1,or,2,or3.

Thanks
 
Use a small "reset button" then.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I'm sorry, the original code for the frame should have been on Double Click event!

Code:
Private Sub YourOptionFrame_DblClick(Cancel As Integer)
 Me.YourOptionFrame = Null
End Sub

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks very much for that. We get there in the end. Double click works fine. Thanks for your persistence.

 
Also you could make another option of "NONE" or "N/A". Use that as the default. Then someone can actually choose it, and no special instructions to 'reset' it.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top