Consulting

Results 1 to 2 of 2

Thread: How to enable a text box depending on radio button groups by vba in word

  1. #1

    How to enable a text box depending on radio button groups by vba in word

    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.


    Last edited by infomamun; 06-18-2018 at 07:18 AM. Reason: adding code chunk

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: https://stackoverflow.com/questions/...by-vba-in-word
    Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •