How to avoid the following error messages?

zhuanyi

Registered User.
Local time
Today, 15:06
Joined
Apr 24, 2007
Messages
66
Hello,
I wrote a module that would require certain modification and creation of tables, however, when I run the module, it kept asking me whether I would like to run the appending query, and considering it is about 40 tables created, it is really annoying that I have to press OK every time, and it would also ask me saying that i am about to append x rows of data, and make me click OK twice...is there a way I could get rid of the messages? Thanks!

Regards,
anyi
 
Set the warnings off
run queries
set warning back on.

if you have error trapping then ensure warnings are set back.
 
How can I set the warning off? What is the VBA statement to do so without freezing the screen? thanks!

Anyi
 
The search feature on the website really does work, and its saves time!

You need:

Code:
DoCmd.SetWarnings(False)

{YOUR CODE}

DoCmd.SetWarnings(True)

Always ALWAYS set the wasnings back to true!
 
Always ALWAYS set the wasnings back to true!

And ALWAYS put an error handler in whatever event you use the SetWarnings code and in the first line of your error handler put:

DoCmd.SetWarnings True

so that if it errors out before it gets to that line in your normal code it will get reset. If you don't, you could wind up without any error messages at all for anything.
 

Users who are viewing this thread

Back
Top Bottom