Additional comments re 2000/2003 vba compact on MVP website

S

Stephen Haley

There is a minor gotcha to the code on the mvp website wtr access 2000 and
maybe 2003

***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

in that if you have the Allow Built-in Toolbars in the startup options
turned off and you are using your own startup toolbar then it will fail with
the comment "cant compact from vba" message which gets very confusing.
There is a solution as you can copy the functionality onto your own startup
toolbar BUT you must display the toolbar before you run the code.
Maybe one of the mvps could add this gotcha to the mvp website to save
others the frustration I have just been through.
(http://www.mvps.org/access/general/gen0041.htm)

rgds
Stephen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top