Compile error: Can't find project or library

L

lhtan123

I don't understand why there is an error message whenever I run this line of
code:

strWhere = Left$(strWhere, lngLen)

** strWhere is a string variable that stores the SQL statement for the where
condition of search criteria.
** lngLen is the no. of characters in the strWhere.

There is no problem with this when I run a similar code for a different
application.

I've checked each SQL statements that append to form the entire string for
strWhere. There is no syntax error.
 
D

Douglas J. Steele

It's probable that your References collection has got messed up.

While in the VB Editor, select Tools | References from the menu bar.

If any of the selected references (the ones with checkmarks at the top of
the list) have "MISSING:" in front of them, unselect them and back out of
the dialog. If you really need the reference(s) you just unselected (you can
tell by doing a Compile, under the Debug menu), go back in and reselect
them. (NOTE: write down what the refereces are before you delete them,
because they'll be in a different order when you go back in!)

If not of them have "MISSING:", select an additional reference at random,
back out of the dialog, then go back in and unselect the reference you just
added. if that still doesn't solve the problem, try to unselect as many of
the selected references as you can (Access won't let you unselect them all),
back out of the dialog, then go back in and reselect the references you just
unselected.

Note that using VBA.Left$ rather than strictly Left$ would likely solve the
problem, but the underlying problem would still be there, and should be
addressed.
 
L

lhtan123

Thanks. It works.

But I'm curious to know what these "MISSING" means.

Would you be able to enlighten me ? Thank you.
 
D

Douglas J. Steele

Access stores the references in the MDB file. MISSING indicates that there's
a difference between the version of the referenced file that the developer
used and the version that's available on the user's workstation. Note that
this can happen even on the same workstation where the application was
developed: installing new software can change the version of shared files.
 
D

Douglas J. Steele

Sorry, that first sentence should really have been "Access stores pointers
to referenced files in the MDB file."
 
L

lhtan123

Thank you very much.

Douglas J. Steele said:
Sorry, that first sentence should really have been "Access stores pointers
to referenced files in the MDB file."
 

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