Full Version: Clearing an Option Group
UtterAccess Forums > Microsoft® Access > Access Forms
Tygler1
I was wondering if anyone knows of a way to clear an option group after a selection has been made in the group. In other words set the option value back to a blank. The reason I want to do this is that my form has a number of option groups on it and if someone accidently chooses a value in the wrong option group I'd like them to be able to clear it.
R. Hicks
Welcome to Utter Access Forums ... smile.gif

Set the value of the Option Group frame to 0 (zero) ...

RDH
Tygler1
You mean to set the "Default value" of the option group fram to "0"? How does that allow me to clear it? do I hit delete after clicking on the value I want to clear?
R. Hicks
You just need to use a button or some event to set the value of the option group frame to 0 ..
That will set the option group to "no choice selected" ...

Me.YourOptionFrame = 0

RDH
GlenKruger
Welcome to UA,
ttached you will find a demo database that will clear the selection in an option group by double clicking in the option group frame and if you double click anywhere in the open space on the form it will clear all option groups.
HTH
Glen
Tygler1
Awsome...that's exactly what I needed! I just created a command button and used your code ( with my frame name of course) with the "on click" propery.
Thank you VERY much
R. Hicks
Great ... You are Welcome ... smile.gif
DH
Tygler1
Glen,
hich code sample contains the example that you refer to? Your link just takes me to the sites main page! Athough I now have a fix for my problem I would be interested in seeing that option as well as you say you can also clear all the option group fields!
Tygler1
Glen,
ever mind.....I just saw the link...I did,'t see the attachment! I have it now. Thank you
GlenKruger
Your Welcome,
posted this as I new Ricky's code would work for you but thought you might not want to use a button.
randy21m
You all seem to know a thing or two about option boxes, so maybe you could help me. I have a form and a subform. A combo box on the form = Set. And on the subform when "set" is chosen, subform= Number, Name, Set, Value.
want to put in an option group of "Numerically, Alphabetically". So that when I choose a "set" in the Form, I can click on the option group to sort them accordingly. Can any of you help me? Thank you.
GlenKruger
Hi you would have to use the after update event of the option group and then check the value and run the code to sort the subform results. Without seeing how you are actually populating your sub form it is hard to give you exact code.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.