Option Group coding

C

ctdak

Upon opening a form which has an Option Group, I want to have my VBA code
either enable or disable one particular option group button. How do I do
this? In other words, how do you modify the attributes of option group
buttons using VBA?
 
A

Allen Browne

You can toggle the availability of an option button like this:
With Me.[NameOfYourOptionButtonHere]
.Enabled = Not .Enabled
End With
 
C

ctdak

Thanks for the answer. I guess I didn't try that. It seems inconsistent
with Access conventions. The option button is a control, not a form
property, so why does this work?

I had tried Me![NameofOptionButton].Enabled, which it seems to me should
work, but it doesn't.

ctdak


Allen Browne said:
You can toggle the availability of an option button like this:
With Me.[NameOfYourOptionButtonHere]
.Enabled = Not .Enabled
End With

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

ctdak said:
Upon opening a form which has an Option Group, I want to have my VBA code
either enable or disable one particular option group button. How do I do
this? In other words, how do you modify the attributes of option group
buttons using VBA?
 

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