cssc1
asked on
What to do with this error when I run the macro Company and repair command button.
I get an error from this code:
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
CommandBars("Menu Bar"). _
Controls("Tools "). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
++++++++++++++++++++++++++ ++++++++++ ++++++
I found this code on line and thought it would work.
++++++++++++++++++++++++++ ++++++++++ +++++++++
See attached image
Error-On-Compact-and-repair-macro.jpg
HBF-Modified-Root-Cause-Analysis-for-Tun
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
CommandBars("Menu Bar"). _
Controls("Tools "). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
++++++++++++++++++++++++++
I found this code on line and thought it would work.
++++++++++++++++++++++++++
See attached image
Error-On-Compact-and-repair-macro.jpg
HBF-Modified-Root-Cause-Analysis-for-Tun
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
;-)
ASKER