Getting rid of a message

P

pvp

I use a doCmd.runSQL to do a delete query off a button on
my form. Is there any way I can stop the 'you are about
to delete ... records message' coming up as I do not need
to confirm deletion.

Thanks.
 
W

Wayne Morgan

You can turn warnings off

DoCmd.SetWarnings False

or you can try a different syntax

CurrentDb.Execute strSQL, dbFailOnError
 
J

jmonty

Yes:

Docmd.Setwarnings False
'Run your query here
'Docmd.runSQL "Delete * From tblCustomers"
Docmd.Setwarnings True
 
Top