How to turn confirmation - yes, no off

K

Karen Middleton

I am running the following

Function Testfunc()
StrSql = "select * into testtab from t000;"
DoCmd.RunSQL StrSql
Endfunction


Function and I get the Yes, No confirmation at the beginning.

Please let me know how I can turn off the Yes, No confirmation.

Also, when I execute some of the Access queries I keep getting Yes/No
confirmation how can I ensure the query runs without the Yes/No
confirmation.

Thanks
Karen
 
R

Roger Carlson

You can bracket the DoCmd with the Set Warnings command:

Function Testfunc()
StrSql = "select * into testtab from t000;"
DoCmd.SetWarnings False
DoCmd.RunSQL StrSql
DoCmd.SetWarnings True
End Function

The danger here is that ALL warnings will be turned off, including many
error messages.
--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top