DoCmd.SetWarnings False doesn't prevent Action Query prompts

I have a little bit of code which ran perfectly in Access 2000 but when it's run in 2002/3 it throws up a prompt for every append the query makes to the table

    DoCmd.SetWarnings False
    mySQL = "DELETE * FROM table_name"
    DoCmd.RunSQL mySQL
    DoCmd.OpenQuery "query_name", acNormal, acEdit
    DoCmd.SetWarnings True

Am I missing something, it blocks all the other warnings, just not the append. Alternatively, is there any way of turning the Access program Action queries option on and off programatically?
pwwoodAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
(Very wild guess)  In Tools:References, check the 'Microsoft ActiveX Data Objects Library' reference, then try to code it this way...

Dim cn as ADODB.Connection
Set cn = CurrentProject.Connection

DoCmd.SetWarnings False
mySQL = "DELETE * FROM table_name"
cn.Execute mySQL

cn.Execute "query_name", acNormal, acEdit   '<--- By the way, is this an action query, or a select?

DoCmd.SetWarnings True
tbsgadiCommented:
Try just DoCmd.OpenQuery "query_name"
tbsgadiCommented:
Try just DoCmd.OpenQuery "query_name"
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

tbsgadiCommented:
They replaced acNormal with acViewNormal

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tbsgadiCommented:
They replaced acNormal with acViewNormal
tbsgadiCommented:
I don't know why everything's coming out twice!
tbsgadiCommented:
Almost everything!
flavoCommented:
open query_name.  Now eye ball it.. Sounds like you have a field name spelt incorrectly.  

I assume the prompt is asking for a field, this field is the one that is incorrect.
pwwoodAuthor Commented:
This is sooo embarrassing. The error wasn't with this bit of code, it was further down the module where I was copying from one table to another. However as all your comments forced me to look at the code again in a different way, you all helped. I gave tbsgadi the extra point for posting so many times :o)
flavoCommented:
LOL.. Glad you got it working.

Good luck with the rest of your project(s)

Dave
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.