Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


DELETE query not asking to confirm action

Posted on 2008-11-06
Medium Priority
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 143

Expert Comment

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

Open in new window

LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 22900053

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

LVL 22

Expert Comment

by:Kelvin Sparks
ID: 22900056

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

Open in new window


Author Comment

ID: 22900359
Thank you so much!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Implementing simple internal controls in the Microsoft Access application.
In this article, I will demonstrate that how to do a PST migration from Exchange Server to Office 365. This method allows importing one single PST, or multiple PST's at once.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

575 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