Running Make table Query without pop-ups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm running some Make Table and Append Queries. Now I want to run all of
them in a row without pop-ups like: "You are about to paste..."
I should appriciate if you are able to provide me a completeed Sub because I
haven't so much experience of VBA programming.
Thank's in advance.
 
start your code with:
DoCmd.SetWarnings False

(your code here)

and end it with:
DoCmd.SetWarnings True

Rocco
 
I'm running some Make Table and Append Queries. Now I want to run all of
them in a row without pop-ups like: "You are about to paste..."

Instead of using

DoCmd.RunSQL "select into etc"

use

CurrentDB.Execute "select into etc", dbFailOnError

This is (a) safer, because you get a trappable error if the query fails,
(b) safer again because you can't forget to switch SetWarnings back one
again, (c) more adaptable because sometimes you'll want to run it against a
different database, and (d) probably a bit quicker.

Hope that helps


Tim F
 
Back
Top