After struggling with some code I am looking for the reasoning behind why the following occurs.
I have a bound combo box (employeeId) with the limit to list property set to Yes, and the bound column = 1.
Entering a erroneus value prompts the "not in list" error message as expected.
But by leaving employeeId blank and leaving the combo box (e.g. tab to next box), the limit to list error message is not displayed.
To catch this error I have to put code into the exit event:
If (IsNull(Me.employeeID.Value)) Then
MsgBox "Please seect an employee from list"
Cancel = True
Me.employeeId.SetFocus
End If
This all works fine and does what I want it to.
But I have 2 questions.
1. Why does leaving employeeId blank or as a null string not trip the Limit to List property, since a blank value is not part of the list?
2. The code I put into the exit event does not work in the after update event, why is this?
Any thoughts would be most interesting
Cheers
Gavin
I have a bound combo box (employeeId) with the limit to list property set to Yes, and the bound column = 1.
Entering a erroneus value prompts the "not in list" error message as expected.
But by leaving employeeId blank and leaving the combo box (e.g. tab to next box), the limit to list error message is not displayed.
To catch this error I have to put code into the exit event:
If (IsNull(Me.employeeID.Value)) Then
MsgBox "Please seect an employee from list"
Cancel = True
Me.employeeId.SetFocus
End If
This all works fine and does what I want it to.
But I have 2 questions.
1. Why does leaving employeeId blank or as a null string not trip the Limit to List property, since a blank value is not part of the list?
2. The code I put into the exit event does not work in the after update event, why is this?
Any thoughts would be most interesting
Cheers
Gavin