Auto yes/no replies

J

Joao Luis Rita

Hello all

I'm trying to run queries that create/delete queries. I want the yes/no
question that pops up to be automatically answered as "yes" but I don't want
to use the "Tools->options" option that does this (need it for other stuff)

I believe that, using a macro, theres's a macro command/option that does
this, but I can't find it... can anyone help?

Thanks for any assistance.
 
T

tina

did you mean to say "queries that create/delete *records*"? and you're
talking about the messageboxes that ask you to confirm the addition or
deletion of records in the table?

if yes to both of the above questions, then what you're looking for is the
SetWarnings macro action. add the action immediately before the OpenQuery
action in your macro, to "turn off" the warning message. note that if you
use the SetWarnings action in VBA code, you also need to use the SetWarnings
action immediately *after* the OpenQuery action to turn warnings back on, as
this will not happen automatically in VBA.

hth
 
J

Joao Luis Rita

tina said:
did you mean to say "queries that create/delete *records*"? and you're
talking about the messageboxes that ask you to confirm the addition or
deletion of records in the table?

if yes to both of the above questions, then what you're looking for is the
SetWarnings macro action. add the action immediately before the OpenQuery
action in your macro, to "turn off" the warning message. note that if you
use the SetWarnings action in VBA code, you also need to use the SetWarnings
action immediately *after* the OpenQuery action to turn warnings back on, as
this will not happen automatically in VBA.

Exactly what I needed! Thank you very much.
 

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