Hello everyone! I'm currently creating an excel userform. My form will contain different questions that are answered with YES or NO using option buttons. If clicked YES, one text box with a follow up question will enable and the other will disable. Same when clicked NO, the other text box will enable and the other will disable.
Now, that works well however, if I click yes, one box will disable and then when I click no, the other box will disable as well. Is there a way to have the command loop so that when the user clicks yes one text box will disable then when clicked no the other text box will disable but enable to other one?
Here's my code for it:
Private Sub rdoQ1NO_Click()
'This is the code to disable one text box when NO is clicked
txtComment.Enabled = True
txtExecutionDate.Enabled = False
txtExecutionDate.BackColor = &H8000000F
End Sub
Private Sub rdoQ1YES_Click()
'This is the code to disable one text box when NO is clicked
txtExecutionDate.Enabled = True
txtComment.Enabled = False
txtComment.BackColor = &H8000000F
End Sub
My other question is when I'm running the form, pressing the tab keys makes the text indicator move from one box to another, however I didn't create my text boxes in order so it jumps around in different order. Is there a way to fix that order or do I just have to create my text boxes in order?
Thank you!!!
Now, that works well however, if I click yes, one box will disable and then when I click no, the other box will disable as well. Is there a way to have the command loop so that when the user clicks yes one text box will disable then when clicked no the other text box will disable but enable to other one?
Here's my code for it:
Private Sub rdoQ1NO_Click()
'This is the code to disable one text box when NO is clicked
txtComment.Enabled = True
txtExecutionDate.Enabled = False
txtExecutionDate.BackColor = &H8000000F
End Sub
Private Sub rdoQ1YES_Click()
'This is the code to disable one text box when NO is clicked
txtExecutionDate.Enabled = True
txtComment.Enabled = False
txtComment.BackColor = &H8000000F
End Sub
My other question is when I'm running the form, pressing the tab keys makes the text indicator move from one box to another, however I didn't create my text boxes in order so it jumps around in different order. Is there a way to fix that order or do I just have to create my text boxes in order?
Thank you!!!