I have a UserForm with the first TextBox that if any text is entered then two new textbooks become visible. The problem is that I cannot get the Focus to move to the first of these just visible Textboxes. I have tried many things but unsuccessfully. Any help or ideas would be welcomed.
My simplified code is:
Option Explicit
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Value <> "" Then
TextBox2.Visible = True
TextBox3.Visible = True
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox2_Exit ", TextBox2
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox3_Exit ", TextBox3
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox4_Exit ", TextBox4
End Sub
Private Sub CommandButton1_Click()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox2.Visible = False
TextBox3.Visible = False
TextBox1.SetFocus
End Sub
Thanks
My simplified code is:
Option Explicit
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Value <> "" Then
TextBox2.Visible = True
TextBox3.Visible = True
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox2_Exit ", TextBox2
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox3_Exit ", TextBox3
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Debug.Print "TextBox4_Exit ", TextBox4
End Sub
Private Sub CommandButton1_Click()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox2.Visible = False
TextBox3.Visible = False
TextBox1.SetFocus
End Sub
Thanks