Compact and Repair

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Does anyone know of a way to run "Compact and Repair" and
close the database immediately after (without running
anything)?

I have a database that automatically runs a macro (via a
form) when opened and when I run Compact and Repair
(manually) it immediately runs the macro after repairing.

Any suggestions are welcome. Thanks in advance.

Gary
 
Basically, the compacting process creates a new copy of your database (the
old uncompacted copy is deleted after compaction). Thus, Access needs to
open the database again and therefore your StartUp options are re-activated.

Depending on what you want, you can use:

1. Hold the Shift Key down while you are compacting the database. This
will bypass the Startup options and stop the Macro from being run (unless
you disabled the AllowBypassKey).

2. Personally, I use Compact-On-Close option (A2K or higher) so that I
don't have to compact manually too often.
 
Thank you for the feedback ... I'm using A2002 ... do you
know if the "Compact-On-Close" option WILL close after
running?
 
When you use the Compact-On-Close option, when ever you close the database,
Access will compact the database before closing. The whole idea is that you
don't have to do Repair and Compact manually.
 
Back
Top