SteveL13
asked on
Compact and repair from command button Access 2010
I have a form which conatins a command button to compact and repair the database when the button is clicked. It doesn't seem to work any longer with Access 2010. Here is my code:
Private Sub Command111_Click()
On Error GoTo Err_Command111_Click
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
Exit_Command111_Click:
Exit Sub
Err_Command111_Click:
MsgBox Err.Description
Resume Exit_Command111_Click
End Sub
I need to be able to compact and repair using 2003 and 2010 (and 2007) with a command button. How can I fix this?
--Steve
Private Sub Command111_Click()
On Error GoTo Err_Command111_Click
CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
Exit_Command111_Click:
Exit Sub
Err_Command111_Click:
MsgBox Err.Description
Resume Exit_Command111_Click
End Sub
I need to be able to compact and repair using 2003 and 2010 (and 2007) with a command button. How can I fix this?
--Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.trigeminal.com/usenet/usenet023.asp?1033
And be aware of this utility:
http://www.trigeminal.com/lang/1033/utility.asp?ItemID=2#2
mx