RunSQL

  • Thread starter Thread starter Dwayne Conyers
  • Start date Start date
D

Dwayne Conyers

We use the following code in a control:

DoCmd.RunSQL newSQL

The newSQL argument runs a query that selects data from diverse tables and
writes into a table we call "temp" -- this table exists only to populate
certain reports that are either saved to disk or e-mailed.

When the RunSQL is executed the user gets two prompts:

(1) The existing table 'temp' will be deleted... do you want to
continue?

(2) You are about to paste one row in to a new table

We would like to silence these prompts and have the actions execute as if
the user pressed "Yes."

The question: what argument(s) or command(s) are required to suppress these
prompts? The help file doesn't provide much in that regard.

Thanks in advance!
 
Dwayne,

Try this:

DoCmd.SetWarnings False
DoCmd.RunSQL newSQL
DoCmd.SetWarnings True
 
Back
Top