Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Errors

Status
Not open for further replies.

hoppergs

IS-IT--Management
Feb 24, 2003
39
GB
I've recently had MS Access 2000 re-installed and since then various functions within VBA are not compiling. For example, functions such as "Format" and "Str" are returning the error "Compile Error - can't find project or library".

I'm assuming that the installation has perhaps missed out a library somewhere, but does anyone know for sure which libraries I would need for these functions to be recognised again?

Thanks

Graham
 
The library containing these functions is the VBA library. However, it is usually another library that cannot be referenced. Remove any unwanted references. If that does not help, try to remove the wanted references and try to restore them. You'll see what reference causes the problem.

Best regards
 
I know Ginger has an FAQ on this subject, so you may want to check the FAQs. Most likely, the new install included the files, but they are now in a different directory.
So DonQuichote's right; you'll need to re-browse to them.
 
Thanks for your responses - all of the correct libraries are installed and I've had Access re-installed twice, but same problem!

I'll play around with removing and adding references as suggested though.

Thanks again.
 
I'm having a similar problem. Only I'm not sure what you mean by references. When I try to open access, I get the compile error, and Microsoft Visual Basic editor opens up. This is the only pc out of 12 that is having this problem. Can someone explain further on what I need to do to fix this problem. Thanks.
 
French, when you're in the Visual Basic Editor click on "Tools - References" - this then brings up a list of items with checkboxes next to them, these are all the libraries that can be used with Access. You'll only need a certain number checked e.g. DAO Object Library, etc.

I think my problem though is that certain dll files are in the wrong location, because I have all the correct libraries ticked but my VBA code is not recognising them.

Hope this helps.

Graham
 
If you need to see if the libraries are in the wrong location, select each library and note the file path and location displayed at the bottom of the dialog box. Next, do a search for that file name from Windows. If the path matches, that one's good. Be sure to let it do a complete search; you may have two versions of the same library causing the problem.
If one of the library paths does not match, uncheck it, then check it again and browse to the correct path, as noted from your search for the file name.
 
I've checked through all of the ticked libraries and their pathnames do match, but in all cases there are multiple copies of the same file in various locations.

Do you think this is what will be causing the problem? I'd rather not remove them unless I'm completely sure!!

Thanks again

Graham
 
You can work around this without deleted them by refreshing the references in code. Check out Ginger's FAQ
faq181-936
 
Thanks guys - I think I've got this fixed now!
 
Great! And for those searching on this subject later, did you use the 'set the reference in code' solution, or did you delete the conflicting copies of the libraries?
 
Funnily enough all I did was de-select the library that the code was a member of, clicked on "OK" to go back to the code, went back into "Tools-References" and then re-selected it.

It now compiles fine........not entirely clear why I had to do this but if it works it works!!

Regards

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top