Phucon-
When users selecting an option from a combo box, instead of clicking on the dropdown arrow to select it, some users like to use key board to type in what they want. Sometimes they delete what's been entered and close the form or exit the application. That triggers the "data type mismatch" or "Invalid use of Null" error. I tried 2 different ways to handle the errors.
1, is to handle it from the beginning of the combo box's AfterUpdate Event procedure:
If IsNull(cboFind) or cboFind = "" Then
Exit Sub
End If
2, I do it in the ErrorHandler section:
If Err.Number = 94 Then
Exit Sub
Else
MsgBox Err.Number & Err.Description
End If
Both ways handled the errors OK, but which one is the better or an appropriate way to do?
Phucon
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar