Hi, all--
This seems a bit simple, but:
I have two date fields on a report menu form for start date and end date.
If the end date is prior to the start date, I want a message to tell the user that and to have the enddate field become null with the focus set on that control.
The null part works fine, but the focus always goes to the next control in tab order and never to the end date control.
My code is this:
Private Sub EndDate_AfterUpdate()
If Me.EndDate < Me.StartDate Then
MsgBox "End Date Cannot Be Prior to Start Date"
Me.EndDate = Null
Me.EndDate.SetFocus
End If
End Sub
Any suggestions?
Thanks.
This seems a bit simple, but:
I have two date fields on a report menu form for start date and end date.
If the end date is prior to the start date, I want a message to tell the user that and to have the enddate field become null with the focus set on that control.
The null part works fine, but the focus always goes to the next control in tab order and never to the end date control.
My code is this:
Private Sub EndDate_AfterUpdate()
If Me.EndDate < Me.StartDate Then
MsgBox "End Date Cannot Be Prior to Start Date"
Me.EndDate = Null
Me.EndDate.SetFocus
End If
End Sub
Any suggestions?
Thanks.