Thread: Delete button
View Single Post
  #2  
Old May 19th, 2010, 08:38 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Delete button

"Dee" wrote in message
...
I used to get a warning message before deleting a record. I no longer get
a
message, it just deletes the record immediately upon clicking the delete
button. I know I can manually add code to fix this, but I would like to
know
why it stopped working automatically. I am using Access 2007 - the
database
was converted from 2003. I tried creating a new form with the delete
button
and i do get the warning.
Is there an easy fix for this?



This commonly happens when you have code that turns the warnings off with
the statement "DoCmd.SetWarnings False", without subsequently turning them
on again with "DoCmd.SetWarnings True". People often turn off warnings so
as to execute an action query without a prompt. However, if you omit to
turn them on again, they'll stay off. It is crucial, if you turn off
warnings, that you have good error-handling inplace to ensure that there is
no way the procedure can be exited, even if an error occurs -- without
turning them on again.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)