By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,761 Members | 1,879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,761 IT Pros & Developers. It's quick & easy.

Automate compact and repair

P: n/a
In an Access 2000 database in Access 2003 (Dutch) I have the following code:

Option Compare Database
Option Explicit

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

Private Sub test2_Click()
CompactDB
End Sub

Following references are checked:
- Visual Basic for Applications
- Microsoft Access 11.0 Object Library

When I press the test2 button I keep getting the error message:
Invalid procedure call or invalid argument.

What am I doing wrong?
Thanks,
John
Dec 25 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.