Automating a make table query

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

Jim/Chris

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

Jim
 
C

Cheryl Fischer

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,
 

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