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
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