Option group in a form

J

Jan T.

Hi. I have a form with an option group with two option buttons.
I have no default value selected, but when the form is loading,
both option buttons are greyed out? When I click one of them, the
other is turning nice and white and the chosen option have this black
dot.
Is it possible to show the option buttons not greyed out at all but with
white color for both buttons and not any option selected as default?

Regards
Jan T.
 
D

Dirk Goldgar

Jan T. said:
Hi. I have a form with an option group with two option buttons.
I have no default value selected, but when the form is loading,
both option buttons are greyed out? When I click one of them, the
other is turning nice and white and the chosen option have this black
dot.

Yes, this is the way it is supposed to behave. When the option group is
Null, the option buttons are displayed as grey -- neither selected nor
unselected.
Is it possible to show the option buttons not greyed out at all but with
white color for both buttons and not any option selected as default?

The only way I know to do this is to give the option group frame a default
value that doesn't correspond to any of the option buttons. So for example,
if you have option values of 1 and 2, you could set the frame's Default
Value to 0, or maybe -1. Then the buttons won't be grey, because the group
has a (non-Null) value, but none of the buttons will be selected.

If you do this, though, you have to take that default value into account in
all your code. You can't assume that Null means "no selection"; rather,
the default value you set means "no selection".

By the way, when I have the Access option set to use Windows themed
controls, which I normally do, I can't actually see any difference between a
greyed-out Null option button and the "white" unselected version. I had to
turn off themed controls in order to test my suggestion.
 
J

Jan T.

That did the trick. I used DefaultValue = -1 and of course I will have to
check for that
value or my to other values (if me.optiongroup.value <> -1 then ...)
I personly think it looks much better this way.

Thanks for your quick reply.

Regards
Jan T.
 

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