Is there a way in Macro where I can create a function to Compact and Repair the database?
I know you can find this function from Data Utilities but I wanna to do you it automatically everytime when user exit the application.
The problem here is that in Access 97 & 2000 the menu option to Compact Database cannot be duplicated from code. Jet requires that the database to be closed before any compact procedures are run. However, there is a utility that you cna use which will close the database, compact it and then re-open the database. You can read more about this by visiting
I just completed a sample databse for Access 97 that uses another small database to do this....You open the new database from your current one, close the current one, the new one does the compacting, and then reopens the current one back for you and closes itself....send an email to my address in my sig block and I will forward it out to you.... Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need!
Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.