Unknown Error

  • Thread starter Thread starter King
  • Start date Start date
K

King

I got the following code from the Access MVPS website (Thanks to those
that directed me there it has been a lifesaver.)

I made a modual for it and inserted the code. I then went the
switchboard manager and made one of my switchboard options runcode
CompactDB. Everything worked great but now it won't work. So I recopied
the code and then reentered the function name. And I still get the
error "There was an error executing the command." Anyone have any
idea's why?

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

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

End Sub
' ***** Code End *****
 
Check you references. You may need to add a reference someplace to make
this work -- someone else may even be able to tell you which one is probably
missing.

Linda
 
Back
Top