Show/hide checkboxes by clicking on an option box.

Sirchemaya Posted messages 7 Status Member -  
Sirchemaya Posted messages 7 Status Member -
Hello,
I've been trying for 2 days to find a solution but to no avail.
Indeed, I have a Word form that has several radio buttons, and I want that when a radio button is pressed, checkboxes are displayed or hidden depending on whether the button is selected or not.
Configuration: Windows / Chrome 88.0.4324.190

7 answers

  1. m@rina Posted messages 27623 Registration date   Status Moderator Last intervention   11 563
     
    Hello,

    We don't know where you're getting stuck, because, basically, it's something simple.
    In the example below, if option button 1 is checked, it will display checkbox 1 and conversely if option button 2 is checked, it will hide the checkbox.

    Of course, it must be ensured from the start that the checkbox is not displayed, to be placed in the UserForm_Initialize

    Private Sub OptionButton1_Click()
    If Me.OptionButton1 = True Then Me.CheckBox1.Visible = True
    End Sub
    Private Sub OptionButton2_Click()
    If Me.OptionButton2 = True Then Me.CheckBox1.Visible = False
    End Sub


    m@rina

    0
  2. Sirchemaya Posted messages 7 Status Member
     
    Hello, thank you for your response. I tried the code, but I have an error: compilation error, method member not found.
    0
  3. m@rina Posted messages 27623 Registration date   Status Moderator Last intervention   11 563
     
    Hello,

    Since you say so little, we actually know nothing.

    You talk about a "form"... but is it really a form (USERFORM)? I replied to you for a Userform.
    Or is it ActiveX controls inserted in the document??

    Can we see the document?
    https://www.cjoint.com/

    m@rina

    --
    From now on, if a user tells me "it doesn't work" without any further information..., I'm giving up!
    0
  4. Sirchemaya Posted messages 7 Status Member
     
    Hello, thank you for your availability. In fact, I am talking about ActiveX controls (radio buttons) to show/hide checkboxes (legacy forms).
    0
  5. Sirchemaya Posted messages 7 Status Member
     
    I placed the document on the link.
    0
    1. m@rina Posted messages 27623 Registration date   Status Moderator Last intervention   11 563
       
      Yes... and how do I retrieve it???
      0
  6. Sirchemaya Posted messages 7 Status Member
     
    Sorry, I would like optionButton1 to display only choice1 if selected, and optionButton2 to display only choice2 if checked, while the other choices disappear. Thank you for your availability.
    0