cancel deletion error

shrive22

Board Regular
Joined
Jun 10, 2002
Messages
120
Here is my problem: I have two forms. THe first one is a snapshot of the data but is has a delete button on it. The delete button calls a macro that opens my second form which is a dynaset, then it closes the first form, then runs the command delete record, then closes the form. In the OnDelete event of my second form I have a macro ConfirmDelete which gives the user a msgbox to either click ok or cancel. When you delete a record and clikc ok to the confirm it works fine but if you click cancel then I get an error "Action Failed"-runcommand which is the command to delete the record

any ideas on how to get rid of this error??

thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I think the error arises because the first macro is triggering the second OnDelete Macro and then when I cancel that it says that one of the actions in the first macro failed.

Still not sure how to fix it?
 
Upvote 0

Forum statistics

Threads
1,221,557
Messages
6,160,477
Members
451,650
Latest member
kibria

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