Compact and Repair

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
 
V

Van T. Dinh

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.
 
G

Guest

Thank you for the feedback ... I'm using A2002 ... do you
know if the "Compact-On-Close" option WILL close after
running?
 
V

Van T. Dinh

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.
 

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