infomamun
06-18-2018, 07:11 AM
I have following activex control in a ms word form
1. Radio Button Group: Name: radioGender
a) radio button: Female> Group Name: radioGender, Name: radioFemale, value=True
b) radio button: Male> Group Name: radioGender, Name: radioMale, value=False
2. Text box: Name: TextBox1I want if a user select Female radio button, then the Textbox1 will be enabled, otherwise Textbox1 will be disabled.
I can get the TextBox1 enabled if set a code on click of Female and Male Radio Option button Separately.
Private Sub radioFemale_Click()
TextBox1.Enabled = True
End Sub
Private Sub radioMale_Click()
TextBox1.Enabled = False
End Sub
But I want instead coding on each radio button, if I can coding on radio button groups, so that based on the selected value of radio button groups, TextBox1 can be enabled/disabled.
What should be the vba code in this case? Please note that I have activex radiobutton in ms word 2010 form.
1. Radio Button Group: Name: radioGender
a) radio button: Female> Group Name: radioGender, Name: radioFemale, value=True
b) radio button: Male> Group Name: radioGender, Name: radioMale, value=False
2. Text box: Name: TextBox1I want if a user select Female radio button, then the Textbox1 will be enabled, otherwise Textbox1 will be disabled.
I can get the TextBox1 enabled if set a code on click of Female and Male Radio Option button Separately.
Private Sub radioFemale_Click()
TextBox1.Enabled = True
End Sub
Private Sub radioMale_Click()
TextBox1.Enabled = False
End Sub
But I want instead coding on each radio button, if I can coding on radio button groups, so that based on the selected value of radio button groups, TextBox1 can be enabled/disabled.
What should be the vba code in this case? Please note that I have activex radiobutton in ms word 2010 form.