Hey guys..I've almost finished writing my code, but I need to know how to get it to work when I leave my text field: I wrote the following code:
Private Sub TextBox4_LostFocus()
If Not IsDate(TextBox4.Text) Then
MsgBox "Please input a valid time."
Else
TextBox4 = Format(TextBox4.Text, "hh:mm:ss AMPM")
End If
End Sub
but when I tab out of textBox4 my code does not trigger. (It does work though if I apply it to a coomand button on click) Anyone see any problems with it to get it to run upon exiting a textbox field? Thanks!
Private Sub TextBox4_LostFocus()
If Not IsDate(TextBox4.Text) Then
MsgBox "Please input a valid time."
Else
TextBox4 = Format(TextBox4.Text, "hh:mm:ss AMPM")
End If
End Sub
but when I tab out of textBox4 my code does not trigger. (It does work though if I apply it to a coomand button on click) Anyone see any problems with it to get it to run upon exiting a textbox field? Thanks!