H
Hoopster
Hey guys,
I have a Form where if the user exits a Control without selecting an
Employee Name, I would like to display a error box and then set the Focus
back to the same Control. I have attched the Code I am using and get the
Error Box but instead of setting the Focus to the same Control, moves on to
the next Control in the TAb Order. Please help.....
Private Sub EmployeeName_Exit(Cancel As Integer)
Dim varEmployee As Variant
If Not IsNull(Me.[EmployeeName]) Then
varEmployee = DLookup("[EmployeeID]", "[EmployeeList]",
"[EmployeeName] = '" & _
Me.[EmployeeName] & "'")
End If
If IsNull(Me.EmployeeName) Then
MsgBox ("You must choose an Employee Name!")
'Forms!EmployeeProformance!EmployeeName.SetFocus
End If
End Sub
I have a Form where if the user exits a Control without selecting an
Employee Name, I would like to display a error box and then set the Focus
back to the same Control. I have attched the Code I am using and get the
Error Box but instead of setting the Focus to the same Control, moves on to
the next Control in the TAb Order. Please help.....
Private Sub EmployeeName_Exit(Cancel As Integer)
Dim varEmployee As Variant
If Not IsNull(Me.[EmployeeName]) Then
varEmployee = DLookup("[EmployeeID]", "[EmployeeList]",
"[EmployeeName] = '" & _
Me.[EmployeeName] & "'")
End If
If IsNull(Me.EmployeeName) Then
MsgBox ("You must choose an Employee Name!")
'Forms!EmployeeProformance!EmployeeName.SetFocus
End If
End Sub