Question : Combo Box Events

I have an unbound combo box on an unbound form. The combo box is populated with a SELECT query on a table connected via ODBC. When the user is not connected to the network, I need to trap the ODBC call error and display message to the user on the form. My question is to what event do I attach error trapping to so that it will execute either when the user begins typing in the combo box or clicks the down arrow of the combo box? Or do I need to trap the error in another way?

I have successfully trapped the error when executing code that also uses the table. Code attached.
Code Snippet:
1:
2:
3:
4:
5:
6:
On Error GoTo err_handler
Exit Sub
err_handler:
If Err.Number = 3151 Then
    FINALMSG = "You do not have network connection."
End If

Answer : Combo Box Events

I was able to capture the ODBC call error with the On_Error event of the form. I can't seem to get rid of the ODBC pop-up dialog, but at least I can pass a more descriptive message to the user on the form itself.
Random Solutions  
 
programming4us programming4us