Full Version: How to avoid a confirmation dialog with executing SQL
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Jelle
Hi,

For some reason I'd like to run some sql when a button is pressed. Unfortunately acces comes up everytime with a stern warning that I am to change n records. That was exactly the intention of a SQL update statement, so the warning is not needed. How can I get rid of it?

This is the code in question:
CODE
    SQL = "UPDATE tbl_CPI SET tbl_CPI.Status = '20' WHERE tbl_CPI.Status = '10';"
    DoCmd.RunSQL SQL, no
MrSiezen
Use Currentdb.Execute instead of DoCmd.RunSQL

Or you can use DoCmd.SetWarnings False. But if you use this, no errors will be shown either, and you must not forget to undo this after the command (DoCmd.SetWarnings True)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.