Hiding message & dialog boxes

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

Is there a way to prevent a warning dialog from popping up like its don't in
excel. Thanks.
 
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
 
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.
 

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

Back
Top