Resume Without Error?

  • Thread starter Thread starter Dave Elliott
  • Start date Start date
D

Dave Elliott

I have a orders form and on it is a command button that runs the below
code.
The code errors out if the user cancels the new object action.
The error message is Resume Without Error
Trying to let the user create labels.


On Error GoTo Err_Command1_Click

DoCmd.RunCommand acCmdNewObjectReport
DoCmd.Close acForm, "Orders"


Exit_Command1_Click:


Err_Command1_Click:
MsgBox err.Description
Resume Exit_Command1_Click
 
Dave Elliott said:
I have a orders form and on it is a command button that runs the below
code.
The code errors out if the user cancels the new object action.
The error message is Resume Without Error
Trying to let the user create labels.


On Error GoTo Err_Command1_Click

DoCmd.RunCommand acCmdNewObjectReport
DoCmd.Close acForm, "Orders"


Exit_Command1_Click:

On Error Resume Next '<<<<Try this
 
Ken Snell [MVP];3323865 said:
Put
Exit Sub

as the code step after
Exit_Command1_Click:

--

Ken Snell
<MS ACCESS MVP>


Yes, yes, yes, a thousand times YES. Something so simple and thanks to this it saved me endless hours of frustration.

Thx.
 
Back
Top