By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

Removing SQL pop-up

P: n/a
Whenever I execute a sql command (using docmd.runsql), it always gives
a popup when executed asking if I want to confirm deleting 3 rows, or
updating 1 row, or whatever. Is there a way to prevent this popup from
appearing?

Aug 7 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
try

DoCmd.SetWarnings False
DoCmd.RunSQL
DoCmd.SetWarnings True

make sure you include that last line, since warnings will not be turned back
on automatically, as they are in a macro.

you can also use

CurrentDb.Execute "SQL string goes here"

without the need for the SetWarnings lines of code. but note that the
Execute action can result in a different outcome than the RunSQL or
OpenQuery actions, when the SQL statement appends records to a table.

hth
<kk*******@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Whenever I execute a sql command (using docmd.runsql), it always gives
a popup when executed asking if I want to confirm deleting 3 rows, or
updating 1 row, or whatever. Is there a way to prevent this popup from
appearing?

Aug 7 '06 #2

P: n/a
"tina" <no****@address.comwrote in message
news:Y3********************@bgtnsc05-news.ops.worldnet.att.net...
try

DoCmd.SetWarnings False
DoCmd.RunSQL
DoCmd.SetWarnings True

make sure you include that last line, since warnings will not be turned
back
on automatically, as they are in a macro.
And assuming you're using some sort of error handling, put the
DoCmd.SetWarnings True in your clean up code, in case you get an error
between the DoCmd.SetWarnings False and DoCmd.SetWarnings True

Emily
>
you can also use

CurrentDb.Execute "SQL string goes here"

without the need for the SetWarnings lines of code. but note that the
Execute action can result in a different outcome than the RunSQL or
OpenQuery actions, when the SQL statement appends records to a table.

hth
<kk*******@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
>Whenever I execute a sql command (using docmd.runsql), it always gives
a popup when executed asking if I want to confirm deleting 3 rows, or
updating 1 row, or whatever. Is there a way to prevent this popup from
appearing?


Aug 7 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.