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

Posted on 2010-01-08
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

    Try running the IDE with administrator rights. Right click "Run As Administrator".
    LVL 1

    Author Closing Comment

    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

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    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…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now