In Acc2K compact automaticaly repairs the database.
The way that I would do it is to use scheduler to call the access database. Not sure if you can do it directly or whether you need to go through a .bat file. At present I call compact.bat to run at 1am and within compact.bat I have the following:
"c:\program files\microsoft office\office\msaccess.exe" "C:\MyFolder\path\MyDB.mdb" /compact
So long as there is no one in the database it ought to work.
The other way is to create a function:
Function Compact_DB()
Call Application.Run("Compacter.DoCompact", False)
End Function
and run this when the last one leaves!
HTH