set warnings

G

Guest

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>
 
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.
 

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

Top