Hi,
I am stumped on how to set focus on a specific field (txtSent) when there is an error. It does show the message box but does not set focus to the txtSent field. Please help, thanks.
Private Sub txtSent_LostFocus()
Dim Date1 As Date
Dim Date2 As Date
Date1 = txtSent.Value
Date2 = txtReceived.Value
If Date1 < Date2 Then
txtSent.SetFocus
MsgBox " Invalid date "
End If
End Sub
I am stumped on how to set focus on a specific field (txtSent) when there is an error. It does show the message box but does not set focus to the txtSent field. Please help, thanks.
Private Sub txtSent_LostFocus()
Dim Date1 As Date
Dim Date2 As Date
Date1 = txtSent.Value
Date2 = txtReceived.Value
If Date1 < Date2 Then
txtSent.SetFocus
MsgBox " Invalid date "
End If
End Sub