PDA

View Full Version : Solved: Disable/enabling radio buttons



will1128
09-20-2010, 06:51 AM
Hi,

I have two radio buttons in a Word 2003, if one is selected I want it to gray out the other. However, if I want to be able to de-select the one I selected and get the current grayed out one active again. Is there a way to do this? So far I've figured out how to disable the radio button on a change, but not re-enable it.

Here's my attempt at the code:

Private Sub ChangeAddBtn_Click()
If ChangeAddBtn.Enabled = True Then
NewDNetSiteBtn.Enabled = False
OptionNew.Enabled = False
OptionNew1.Enabled = False
End If
End Sub

Thanks

fumei
09-20-2010, 10:11 AM
If they are ActiveX butons, and they are grouped together (using GroupName in the Properties), then this behaviour is built in.

will1128
09-20-2010, 10:22 AM
How would I be able to tell if they are ActiveX controls? (Really new at this. :think: )

I did group them together, but I'm assuming they aren't ActiveX because when I click one to activate it, it doesn't gray out the other. Why not?

fumei
09-20-2010, 11:30 AM
If it has a Click event, it is an ActiveX control.

Go into Design mode, and right click a control. Select Properties. If you had not clicked the control you want to adjust, select it from the list of controls under the top dropdown.

Go down to Groupname. Give it a name. Find the other control you want to group it with, and give it the same name.

Oh, and it does not gray out th eother one. It simply toggles them. Optionbuttons grouped allows only ONE to be True.

Perhaps if you explained what it is you are trying to do?