[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Compile error: Cant find project or library - Access 2007 / Windows 7

Posted on 2010-01-08
Medium Priority
Last Modified: 2012-08-14
I have an Access 2007 database.  My XP computer hard drive recently crashed.  I put in a new hard drive and had to install Windows 7.  The database works on an XP machine.

When I try to run my database, I get the error:

Compile error: Cant find project or library

This error also occurs when I open some of the forms.

I do not have any references identified as missing.

The references I have are (in order)
      Visual Basic For Applicxations
      Microsoft Access 12.0 Object Library
      OLE Automation
      Microsoft Office 12 Authorization Control 1.0 Type Library
      Microsoft Office 12.0 Object Library
      Microsoft Office Outlook View Control
      Microsoft Outlook 12.0 Object Library
      Microsoft ActiveX Data Objects 2.0 Library
      Microsoft DAO 3.6 Object Library

If I try to complie, I get the compile error again.

The first error occurs when I open the Main Page.  It hangs on the code vb code:

      'Counts all files in the folder C:\ACRdocuments\Images\BGimages\
               Set objFiles = fso.GetFolder("C:\ACRdocuments\Images\BGimages").Files
                CountFiles = objFiles.Count

It hangs on on pages with the On Current event and there is a Date in the code.

                     Me.OrderDt = Date

Any ideas?
Question by:Scamquist
LVL 29

Accepted Solution

nffvrxqgrcfqvvc earned 1500 total points
ID: 26236720
Try running the IDE with administrator rights. Right click "Run As Administrator".

Author Closing Comment

ID: 31674889
I was not sure how to run this as an Admin...but, when I poked around, trying to get to it, I got one of the references to show up as missing.  Removed and replaced the reference and it worked.  Not sure if your suggestion did it, but you put me in a direction, so thanks.


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question