Resume Without Error?

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
 
A

Arvin Meyer

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
 
Joined
Mar 22, 2012
Messages
15
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top