DELETE query not asking to confirm action

Posted on 2008-11-06
Last Modified: 2012-05-05
Hi everyone,
I created a delete query in Access, then I execute as follows:

Docmd.openquery "MyDeleteQuery"

But my problem is that it asks for a confirmation "you're about to delete all records, are you sure??" but is there any way to avoid this, and to delete the records without asking???

Thanks in advance

Question by:Ivette_Diaz
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    DoCmd.DisplayAlerts false
    Docmd.openquery "MyDeleteQuery"
    DoCmd.DisplayAlerts true

    Open in new window

    LVL 75

    Accepted Solution


    DoCmd.SetWarnings False
    Docmd.openquery "MyDeleteQuery"
    DoCmd.SetWarnings True

    LVL 22

    Expert Comment

    by:Kelvin Sparks

    I think DisplayAlerts is an Excel function
    DoCmd.SetWarnings False
    Docmd.openquery "MyDeleteQuery"
    DoCmd.SetWarnings True

    Open in new window


    Author Comment

    Thank you so much!

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now