Prevent Action Failed Dialog from Popping up-Macros

Joined
Dec 27, 2002
Messages
31
I am new to creating databases and I have created command buttons that runs macros. Lets say I double click a button that I only wanted to click once. For example if I click my save button More than once, I get an action failed box. With an option to halt. Well I want the Action Failed box to stop popping up. I would like to have the macro automatically halt. I am going to present this database to people and I dont want them to get that halt or step into dialog everytime they click something they cant do right then. I have created some message boxes that just have ok buttons, but they pop up in addition to the action failed. I want just the message box to come up. I tried setwarnings property to False that did not stop the action failed.

Thanks for your expertise
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try something like this

Private Sub Your sub name here (DataErr As Integer, Response As Integer)
On Error Goto YourErrorHandler

What you want to happen goes here

YourErrorHandlerExit:
Exit Sub
YourErrorHandler:

Response = acDataErrContinue

Resume YourErrorHandlerExit
End Sub

This should suppress errors, the problem with this is it will suppress errors that you may need to see during development.
 
Upvote 0
After review of my response I realized I may have given too much info, I would suggest using the following part of the first response

YourErrorHandlerExit:
exit sub


YourErrorHandler:

What ever else you need in this errorhandling section

Resume YourErrorHandlerExit

Likely may be happening is your error handler is sending your error back up to where the error occured causing a double report of said error. I hope this helps
 
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,341
Members
451,638
Latest member
MyFlower

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top