Automating a make table query

  • Thread starter Thread starter Francesca Sullivan
  • Start date Start date
F

Francesca Sullivan

Hi,

How does one go about automating a make-table query? I need to run one in
the background, without it having the user see a pop-up dialog telling them
that this is happening.

F-
 
Create a macro with a make table query
Macro
SetWarnings to no
OpenQuery
Setwarnings to Yes

Jim
 
There are a couple of ways to do this, Francesca ...

1. Use the SetWarnings method:

DoCmd.SetWarnings False
DoCmd.OpenQuery "MyQuery"
DoCmd.SetWarnings True

2. CurrentDB.Execute "MyQuery", dbFailOnError

3. If you do not have a named/saved query, you can also use:

CurrentDB.Execute "SELECT [MyTable].* INTO MyNewTable FROM [MyTable]",
dbFailOnError

hth,
 
Back
Top