supress warning messages

emcf

Member
Local time
Today, 22:23
Joined
Nov 14, 2002
Messages
209
morning all,

i've got a command button on a form that runs 3 queries - 2 delete queries and one append query. every time i click the button the warning boxes appear.....is there any way that i can shut these off? the queries are run using vb code on the on click event.

thanks in advance....
 
Warnings on and off

"....the warning boxes appear.....is there any way that i can shut these off?......."

DoCmd.SetWarnings False .......'Turns warnings off

Your query/s in here

DoCmd.SetWarnings True ........'Remember to turn them back on (you may want them on elsewhere)
 
Code:
With DoCmd
    .SetWarnings False
    .OpenQuery "Query1"
    .OpenQuery "Query2"
    .OpenQuery "Query3"
    .SetWarnings True
End With
 
Or, since these are action queries, use the Execute method like this (it automatically suppresses the warnings):

DAO:
Currentdb.Execute query

ADO:
CurrentProject.Connection.Execute query
 

Users who are viewing this thread

Back
Top Bottom