How to turn confirmation - yes, no off

  • Thread starter Thread starter Karen Middleton
  • Start date Start date
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
 
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
 
Back
Top