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

Linq Adams via AccessMonster.com

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.

At any rate, I think you can safely remove all of them, using Find/Replace
with the "Current Project" option, and see if that helps.

As always when making big changes, keep a backup copy of the original v97
file safe.
 
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.
 
L

Linq Adams via AccessMonster.com

Broken references are always #1 on the Hit Parade when an app heads south in
moving from one machine to another, or from one version to another. AS I said,
I've seen reports similar to this when moving apps up to v2007. Unfortunately,
I've never seen a resolution posted.It may very well be, as you suggested, a
combination of things, which makes troubleshooting all the harder to perform..
 

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