Typically, you would use a maintenance application that fires off using the
Windows scheduler at a predetermined time when you know that nobody will be
in the database. One great product for scheduling compacts is Total Access
Agent:
One problem you will have if it is a multi-user system is someone who
"forgets" (I'm being kind here) to log off, thus keeping the database locked
.. For those wonderful users I have some code and a sample application on my
website to Kick Em Off:
You can use the JetComp.exe utility on the Microsoft Website. I had a
situation where I had to do manual updates each morning for my
database, so I had all the users log off and I compacted it then. You
can automate it using Windows Scheduler to run at night though.