IF Condition - Display or Hide TextBox

1

Expensive,

I have 4 optionButton (2 different groups), where 2 represent "Yes" and "No" for two different questions.

What I want to do:

When the user chooses the NO option in group1 and then chooses the YES option in group2, a textbox is displayed to explain why the answers are not the same (I already can do this).

And when he changes the option from group1 to YES, group2 has to hide the textbox field.

Detail: The optionButtons are multi-different *

Problem:

When the user is changing the option from group1 to YES, he is not hiding the textbox from group2.

Code so far:

Private Sub UserForm_Click()
If simSIMONI.Value = naoSISUP.Value Then
    motNaoSIMONI.Visible = True
    labMotNaoSIMONI.Visible = True
End If
End Sub
    
asked by anonymous 06.11.2017 / 11:01

1 answer

1

Expensive,

Solved. I tried not to have to validate on every optionbutton, but I could not.

I put the validation on some optionButtons with if.

Example of the code

Private Sub simSISUP_Change()
If simSIMONI.Value = True And simSISUP.Value = True Then
    motNaoSIMONI.Visible = False
    labMotNaoSIMONI.Visible = False
End If
End Sub


Private Sub simSIMONI_Change()
If simSIMONI.Value = True And naoSISUP.Value = True Then
        motNaoSIMONI.Visible = True
        labMotNaoSIMONI.Visible = True
    Else:
        motNaoSIMONI.Visible = False
        labMotNaoSIMONI.Visible = False
End If
End Sub
    
06.11.2017 / 14:42