Compiler Error Can't find object or library

  • Thread starter Michael Trombetta
  • Start date
M

Michael Trombetta

I am trying to convert an Access 97 database to Access 2007. I get the error
message: "Compiler Error Can't find object or library" on the following code.

Err_AddBook_Click:
MsgBox Error$
Resume Exit_AddBook_Click

when the compiler encounters Error$.

Any help would be appreciated.
 
D

Dirk Goldgar

Michael Trombetta said:
I am trying to convert an Access 97 database to Access 2007. I get the
error
message: "Compiler Error Can't find object or library" on the following
code.

Err_AddBook_Click:
MsgBox Error$
Resume Exit_AddBook_Click

when the compiler encounters Error$.

Any help would be appreciated.


In the VB editor, click Tools -> References..., and look for any marked
MISSING. If there are any, un-check them and, if there's an Access 12 or
Office 12 equivalent, check that one instead. If you un-checked some
references, try recompiling and see if any compile errors are raised. If
not, try running the code again and see if the problem has gone away.
 
D

Dirk Goldgar

Linq Adams via AccessMonster.com said:
If no references show up as missing, the problem may be with the dollar
sign
at he end of Error$. This is a hold over from the early Basic days, and
while
in versions up thru v2003 they'll work, I've been seeing reports for a
while
of the code failing in v2007.

FWIW, I tested the code in Access 2007, with the dollar sign, and it worked
fine. So while that *may* be it, there must be some other contributing
factor. I'm still inclined to think it's a broken reference.
 

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