delesect or clear out option group..

G

Guest

i have 3 checkboxes in option group..default opens as none valued..when 1 is
selected, then wish to later de-select to have none valued, always keeps one
valued..

am i using wrong control in option?
 
G

Graham Mandeno

If you set the option group value to Null then all the boxes will be grey.
If you set it to a number which no button has a matching option value then
all the boxes will be white. In both cases none will be checked.

You can only do this through code though, so if you want some way for the
user to clear the selection you must use the click event of a control on
your form. For example, you could add a small "Clear" command button at the
bottom of your option group frame and its Click event would execute the
code:

Me.[OptionGroupName] = Null
 
G

Guest

I normally use the Double Click event of the group control. In that event
place code like:

me.NameOfGroupControl = 0 (that's a zero)

Then when you want to clear all check boxes, you just double click the group
control.
 
G

Guest

Thanks much!!

Mr B said:
I normally use the Double Click event of the group control. In that event
place code like:

me.NameOfGroupControl = 0 (that's a zero)

Then when you want to clear all check boxes, you just double click the group
control.
 
G

Guest

Just remember that 0 is sometimes a value, so you might consider changing it
to Null.
Also, if there is no default (0) in that field, when you create a query to
filter on fields that there is no value selected, you'll need to write

Where [FieldName] = 0 Or [FieldName] Is Null

So you better, either set the default of the field to 0, or set the option
group to Null.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top