Hello,
I want to add a code to run when a database is closed that performs the Compact and Repair function.
I found the code listed below, but I having trouble making it work.
Also, if I can get this code working, does anyone know if I can prevent the database from reopening after this function?
Thanks
I want to add a code to run when a database is closed that performs the Compact and Repair function.
I found the code listed below, but I having trouble making it work.
Also, if I can get this code working, does anyone know if I can prevent the database from reopening after this function?
Thanks
Public Sub CompactDB()
CommandBars("Menu Bar").Controls("Tools").Controls("Databaseutilities").Controls("Compact and repair database...").accDoDefaultAction
End Sub