Hiding message & dialog boxes

A

Ayo

Is there a way to prevent a warning dialog from popping up like its don't in
excel. Thanks.
 
D

Dale Fye

Depends on what you are doing. If you are executing some sort of action
query, then there are a couple of ways.

1. You can preceed and follow the code with statements turning the warning
off/on
Docmd.SetWarnings False
'some code here
Docmd.setWarnings True

2. You could use the Execute method to run the query. This bypasses the
warning messages and, unless you explicitly tell it to warn you if the action
fails, will not give you any indication regarding the success or failure of
the execution. I generally add the "dbFailOnError" option and provide some
error handling code so that I can identify errors that occur and handle them
properly.

Currentdb.Execute strSQL, dbFailOnError

HTH
Dale
 
T

Tom van Stiphout

On Tue, 19 Feb 2008 20:45:00 -0800, Ayo

Perhaps you are referring to:
DoCmd.SetWarnings False
....do your thing
DoCmd.SetWarnings True

-Tom.
 
Top