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

  • Thread starter Thread starter Duncs
  • Start date Start date
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
 
:
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
 
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).
 
Back
Top