When running action query using code, you can set the warning to False
DoCmd.SetWarnings False
' run your query
DoCmd.SetWarnings True
=============================
Or
CurrentDb.Execute "QueryName" , dbFailOnError
=============================
If you want to set the warnings off when you delete or append directly to
the query or using code, then in the menu bar select
Tools > Options > Edit/Search (Tab) > Confirm Action Queries (remove the
selection)
But you have to remember that it will never prompt with the message event
when
you are using the queries directly
==============================