Warning Message

W

Wavequation

I am using a docmd.runSQL line of code to run a delete query. Is there
anyway I can turn off the warning message box that pops up?
 
J

Jack Leach

DoCmd.SetWarnings False


BE CAREFUL!!!

Also use an exit procedure and error handler that redirects to it... and be
SURE to turn DoCmd.SetWarnings True in the exit procedure of the
sub/function. You don't want to accidently leave this off.

Alternatively, use CurrentDb.Execute <query> instead, which by design gives
no warnings. The drawback here is that you can't use the Expression Service.
On the plus side, dbFailOnError as the second argument will throw an
trappable error, which you can't get with DoCmd.RunSQL

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 

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