Delete error message problem

  • Thread starter Thread starter carlee
  • Start date Start date
C

carlee

Hi there,

i have a delete button on my form with the following code:

docmd.runcommand.acCmdDeleteRecord

When i run the code click delete, i get a message asking
if i am sure i want to delete. If i click yes all is
good. If i click no, i get an error stating " the run
command action was cancelled" How can I prevent this from
occuring.

I want to be able to cancel the delete if i don't want to
delete the record.

Regards,
Carlee
 
docmd.setwarnings false

Dont forget to turn the warnings back on after the delete, or you will no longer
receive system messages anywhere in the app.

DoCmd.SetWarnings False
DoCmd.RunCommand.acCmdDeleteRecord
DoCmd.SetWarnings True


Wayne Gillespie
Gosford NSW Australia
 
Back
Top