UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to avoid a confirmation dialog with executing SQL    
 
   
Jelle
post May 23 2006, 04:10 AM
Post #1

UtterAccess Member
Posts: 24



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
Go to the top of the page
 
+
MrSiezen
post May 23 2006, 04:14 AM
Post #2

UtterAccess Ruler
Posts: 2,198
From: Den Bosch - Netherlands



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)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 02:21 PM