How to re-set focus to the text box after deleting invalid data?
Hi Vinay,
Tou can use the exit event for the textbox:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox1.Text) Then
MsgBox "DATE ENTERED IS INVALID. PLEASE RE-ENTER",
vbExclamation, "Retry"
Me.TextBox1.Text = ""
Cancel = True
End If
End Sub
Hoop This Helps
Wouter
|