set warnings

C

Chris

I would like to know if i can turn the usualy database warnings off. i know
the option on the tool bar, but i want to turn it off in the database itself.
i know the set warnings switch in macros and vb, but access reverts back to
on after the routine or the macro. is there anyway to globally do this from
the start of the DB. Thanks for any info.

Chris
 
D

Douglas J. Steele

It's generally not a good idea: sometimes those warnings have useful
information in them!

If you're specifically concerned about the "You're about to delete n
records" type of warnings you get when running action queries, try using the
Execute method of the Database or QueryDef objects, rather than
DoCmd.RunSQL.

I've never heard of Access resetting the warnings setting on its own,
though.
 
J

Jeff Boyce

Chris

I'm with Doug ... it sounds like you have already determined the solution
("turn off warnings"), but I have no idea what problem you are solving.

Regards

Jeff Boyce
<Office/Access MVP>
 
J

jahoobob

If you want to turn them off for users of an application, you can run
everything through macros in which you first Setwarnings to No. or in
code, DoCmd.SetWarnings False. They will not see warnings such as "You
are about to add 123 records to...." or "You are about to delete 10,109
records..." when they run an append query. There is nothing wrong with
that.
Other than that, what Jeff and Doug said!
 
S

Steve Schapel

Douglas said:
I've never heard of Access resetting the warnings setting on its own,
though.

If a SetWarnings/No action is used in a macro, the warnings setting
automatically reverts at the conclusion of the macro's execution.
Whereas in a VBA procedure, you must explicitly set the warnings back on
again.
 
Top