Help with option groups

C

ctdak

I haven't used option groups before. I have created one on a form and am trying to use VBA code to get each radio button to run a report when the user clicks on it. However, the buttons are all shaded and won't respond. If I set the option group default value to one of the button's values, then that one shows as a default (black) and the others are clear (not shaded) but still none of them will respond

Also, I placed a command button on the form and coded it to generate a report based on the value of the option group. The option group default value is still determining what report I get when clicking on the command button. I still can't select a radio button of my choice and get the option group value to change accordingly

What am I missing
 
K

Ken Snell

Be sure that your code for running the report is attached to the AfterUpdate
event of the option group.

The behavior that you describe when you have no default value is
appropriate. Setting a default value in the properties will not cause the
AfterUpdate event to run, however. That occurs only when the user clicks on
a button and changes the value of the option group.


--
Ken Snell
<MS ACCESS MVP>

ctdak said:
I haven't used option groups before. I have created one on a form and am
trying to use VBA code to get each radio button to run a report when the
user clicks on it. However, the buttons are all shaded and won't respond.
If I set the option group default value to one of the button's values, then
that one shows as a default (black) and the others are clear (not shaded)
but still none of them will respond.
Also, I placed a command button on the form and coded it to generate a
report based on the value of the option group. The option group default
value is still determining what report I get when clicking on the command
button. I still can't select a radio button of my choice and get the option
group value to change accordingly.
 
C

ctdak

Ken
Thanks for the reply. I didn't know to associate the code with the AfterUpdate event of the option group, so I have done that now. However, it didn't help. Clicking on the option group buttons does nothing. The option group is just not working. I can't select any of the options. Any further ideas
ctda

----- Ken Snell wrote: ----

Be sure that your code for running the report is attached to the AfterUpdat
event of the option group

The behavior that you describe when you have no default value i
appropriate. Setting a default value in the properties will not cause th
AfterUpdate event to run, however. That occurs only when the user clicks o
a button and changes the value of the option group


--
Ken Snel
<MS ACCESS MVP

ctdak said:
I haven't used option groups before. I have created one on a form and a
trying to use VBA code to get each radio button to run a report when th
user clicks on it. However, the buttons are all shaded and won't respond
If I set the option group default value to one of the button's values, the
that one shows as a default (black) and the others are clear (not shaded
but still none of them will respondreport based on the value of the option group. The option group defaul
value is still determining what report I get when clicking on the comman
button. I still can't select a radio button of my choice and get the optio
group value to change accordingly
 
S

Steve Schapel

Ctdak,

Can you check the properties of the Option Group, and make sure Enabled
is set to Yes and Locked is set to No.
 
K

Ken Snell

And check that each option button is actually a member of the option group.
It's possible that one or more of the buttons is existing as a "free"
control, not part of the option group. You may need to recreate the option
button to be sure.
 

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