Unknown Error

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

Linda Burnside

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top