I have a date range entry into a form:
Enter Date From: 99/99/99 To: 99/99/99
An On Exit Event procedure is set for to date:
Private Sub On_exit_click()
If fromDate>toDate then
MsgBox "Date range Incorrect", vbCritical, "Entry"
Me!ToDate.SetFocus 'refocus on Todate
End if
End Sub
The problem is if error triggers, it will display the message and then continue on the next entry.
I want that if the event is trigggered not to allow the user to continue but rather go back to the toDate. I thought the setfocus will do that.
Please advise on solution.
Thank you.
Dré
Enter Date From: 99/99/99 To: 99/99/99
An On Exit Event procedure is set for to date:
Private Sub On_exit_click()
If fromDate>toDate then
MsgBox "Date range Incorrect", vbCritical, "Entry"
Me!ToDate.SetFocus 'refocus on Todate
End if
End Sub
The problem is if error triggers, it will display the message and then continue on the next entry.
I want that if the event is trigggered not to allow the user to continue but rather go back to the toDate. I thought the setfocus will do that.
Please advise on solution.
Thank you.
Dré