Error when cancelling query

  • Thread starter Thread starter rblivewire
  • Start date Start date
R

rblivewire

I have a switchboard and on the switchboard is a combo box with my list
of queries. The user can choose any query from this combo box. Some
queries have it set u so it asks for a parameter value. If the user
cancels this request, I get a runtime error and it asks to debug. How
do i get this runtime error from not showing up when the user cancels
the request?
 
I have a switchboard and on the switchboard is a combo box with my list
of queries. The user can choose any query from this combo box. Some
queries have it set u so it asks for a parameter value. If the user
cancels this request, I get a runtime error and it asks to debug. How
do i get this runtime error from not showing up when the user cancels
the request?

Trap Error 2501 in the event on the switchboard form that opens the
query.

On Error GoTo Err_Handler
DoCmd.OpenQuery etc....
Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error " & Err.Number & " " & Err.Description
End If
Resume Exit_Sub
 
Back
Top