Switchboard Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get an error 2501 any time I cancel a switchboard operation that needs user
input before occurring, e.g. criteria for a report. When I go to debug, it
highlights the docmd line in the select caseportion of the HandleButtonClick
code for the switchboard. The switchboard was created using the switchboard
manager so I am not very familiar with the code.

TIA, Ann
 
I get an error 2501 any time I cancel a switchboard operation that needs user
input before occurring, e.g. criteria for a report. When I go to debug, it
highlights the docmd line in the select caseportion of the HandleButtonClick
code for the switchboard. The switchboard was created using the switchboard
manager so I am not very familiar with the code.

TIA, Ann


Trap the error in the Switchboard HandleButtonClick Error Handler.

HandleButtonClick_Err:
If (Err = conErrDoCmdCancelled) Then
Resume Next
ElseIf Err = 2501 Then
Resume HandleButtonClick_Exit
Else
MsgBox "Error #: " & Err.Number & " There was an error executing
the command.", vbCritical
Resume HandleButtonClick_Exit
End If

Notice that I also changed the default error message by adding the
error number to the message for your information if a different error
# arises.
 
Fred, thanks for your assistance. I pasted your suggested code and I am
still getting the 2501 error. Does this have to do with the fact that I am
also cancelling the report/form query?

Happy Monday, Ann
 
Back
Top