G
Guest
Hi all,
Can someone tell me why the following code isn’t working correctly?
I have a TimeDepart and a TimeReturn controls. When someone enters a
TimeReturn before the TimeDepart it generates a message and clears out the
TimeReturn then the focus is returned to the TimeReturn.
Everything works fine except setting the focus back on TimeReturn. The focus
goes to the Coordinator control. The Coordinator control is next in the Tab
Order. I’ve tried moving different controls in the Tab Order and whatever
control is after TimeReturn it sets the focus there. Basically the Tab Order
is taking control over the code.
I’m having the same type of problem with another database. I’ve used the
SetFocus like this before and until recently have not had any problems.
Private Sub TimeReturn_AfterUpdate()
If TimeReturn < TimeDepart Then
MsgBox "You entered an improper time. You can't return before you leave.
Enter another return time."
TimeReturn.SetFocus
TimeReturn = ""
Else
Coordinator.SetFocus
End If
End Sub
Thanks for the help,
Paul
Can someone tell me why the following code isn’t working correctly?
I have a TimeDepart and a TimeReturn controls. When someone enters a
TimeReturn before the TimeDepart it generates a message and clears out the
TimeReturn then the focus is returned to the TimeReturn.
Everything works fine except setting the focus back on TimeReturn. The focus
goes to the Coordinator control. The Coordinator control is next in the Tab
Order. I’ve tried moving different controls in the Tab Order and whatever
control is after TimeReturn it sets the focus there. Basically the Tab Order
is taking control over the code.
I’m having the same type of problem with another database. I’ve used the
SetFocus like this before and until recently have not had any problems.
Private Sub TimeReturn_AfterUpdate()
If TimeReturn < TimeDepart Then
MsgBox "You entered an improper time. You can't return before you leave.
Enter another return time."
TimeReturn.SetFocus
TimeReturn = ""
Else
Coordinator.SetFocus
End If
End Sub
Thanks for the help,
Paul