One approach would be to use the JRO Objects - add to the project the Jet and Replication Objects library. Then in the click event of the button, something like the following:
Set JRObj = New JRO.JetEngine
JRObj.CompactDatabase "Data Source=c:\olddb.mdb;", "Data Source="c:\newdb.mdb;"
Set JRObj = Nothing
then delete the old db and rename the new one back to the original name Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein