Hi - when I display a message box showing an error, how do I prevent focus from moving to the next field?
I have the following code (thanks to MakeItSo!) :
If DCount("Emp_Id", "qry_Employee_Passed_Course"
> 0 Then
MsgBox "That employee sat and passed this course within the last 2 years", vbCritical, "Error"
End If
I would have thought the vbCritical style of message would prevent the focus from moving away from the employee field, but no - it goes on to the next field.
I've put this code into the Emp_Id_Exit event, but then I can't get away from the Emp_Id field, even by pressing Esc. I know it's something simple, but just can't get it.
Thanks,
Jenne.
I have the following code (thanks to MakeItSo!) :
If DCount("Emp_Id", "qry_Employee_Passed_Course"
MsgBox "That employee sat and passed this course within the last 2 years", vbCritical, "Error"
End If
I would have thought the vbCritical style of message would prevent the focus from moving away from the employee field, but no - it goes on to the next field.
I've put this code into the Emp_Id_Exit event, but then I can't get away from the Emp_Id field, even by pressing Esc. I know it's something simple, but just can't get it.
Thanks,
Jenne.