Ok ..Finally I see some light here. I finished my validate code, but one problem.... my code is not setting focus properly upon error. Although it works when I apply my code to a command button (Ive created an Excel form with multiple text boxes) it will not work when I tab out of the field. I mean I receive the correct error message, but it just tabs out of the field and does not set the focus back into the errored text field. My code is as follows:
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox4.Text) Then
MsgBox "Please input a valid time."
TextBox4.SetFocus
Else
TextBox4 = Format(TextBox4.Text, "hh:mm:ss AMPM")
End If
End Sub
Any help setting the focus back to the error field?? It has to be something with that textBox4.set focus line of code... Im not including. . .Thanks -C
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox4.Text) Then
MsgBox "Please input a valid time."
TextBox4.SetFocus
Else
TextBox4 = Format(TextBox4.Text, "hh:mm:ss AMPM")
End If
End Sub
Any help setting the focus back to the error field?? It has to be something with that textBox4.set focus line of code... Im not including. . .Thanks -C