Turn off sql warnings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I receive the following "warnings" when running an SQL statement -

The existing table 'tablename' will be deleted before you run the query

then

You are about to paste XX row(s) into a new table

How can I turn these messages off?
Thank you
 
The statement is: Docmd.SetWarnings FALSE

To turn them back on: Docmd.SetWarngings TRUE

BE CAREFUL with these statements. If you turn the warnings off, they are off
for the ENTIRE application and (I believe) the settings are saved when you
exit the application. If someone has access to the database window and hits
the delete key on one of the objects... BYE-BYE!

Make sure you turn it back on when you exit the subproc or function. For
example:

Public Sub TestMe()

On Error GoTo Proc_Err

Docmd.SetWarnings False
:
: code goes here
:

Proc_Exit:
Docmd.SetWarnings True

Proc_Error:
Msgbox Prompt:=Error.Description
Resume Proc_Exit

End Sub

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
hi,
tools>options>edit/find tab>confirm box
uncheck record changes, doc deletions, action queries
regards
Frank
 
Back
Top