Turning off warnings

Jim W

Registered User.
Local time
Today, 16:18
Joined
Feb 4, 2003
Messages
198
I have code that runs 3 queries in order that delete and recreate a table. The code works fine but each time it runs the queries I get warning messages. I would like to turn them off so I put the DoCmd.Setwarnings False
line before the 1st query and now when I click the command button the queries do not run.

Why?

Jim
 
Do the queries run fine when you have the warnings turned on? Because if there was an error, you will not have been informed about it and the queries won't have changed. I think thats the case here.

"DoCmd.Setwarnings False" shouldn't affect your code at all, you just aren't prompted for comfirmation.
 
Pat Hartman said:
When you trun warnings off this way in your code, you should turn them back on IMMEDIATELY after the queries run. It is especially dangerous to have warnings off in a database where you might be changing objects. A bad side effect for example is if you modify a form and close without saving, Access won't prompt you to save. It will simply discard the changes and close the form.

Pat,

I don't know if we are talking about the same thing but when I have SetWarnins....No..... in macros it only applies to that macro. In Access 95 Setwarnings in macros defaults to No

Mike
 

Users who are viewing this thread

Back
Top Bottom