Compact & Repair, Open table, close table, then run macro

D

Duncs

I have an Autoexec macro in a dadabase that runs a delete query and
imports some data. It then executes an append query before opening a
table.

What I want to do in the Autoexec is:

Run delete query
Compact and Repair database
Import data
Run append query
Open table
Run other macros

However, I get an error with the compact & Repair...I can't run it
from VBA or a macro, or something like that. Also, wouold the 'Run
other macros' wait until the table was closed, or would they continnue
regardless?

Duncs
 
D

David-W-Fenton

:
What I want to do in the Autoexec is:

Run delete query
Compact and Repair database
Import data
Run append query
Open table
Run other macros

However, I get an error with the compact & Repair...I can't run it
from VBA or a macro, or something like that. Also, wouold the
'Run other macros' wait until the table was closed, or would they
continnue regardless?

Perhaps this will help:

http://trigeminal.com/lang/1033/utility.asp?ItemID=8#8
 
D

David-W-Fenton

m:
Looks like a good idea but, the problme is I'd need to install
the .DLL on every PC that the database will run on. Also, it
doens't answer the question of whether I can suspend macro
execution until the table is closed.

Well, the fact is, you can't compact a database that is open in the
UI. Indeed, there is almost no case where that is required, as users
should only ever open the front end, and front ends don't need to be
compacted (unless they are badly designed).
 

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