Error when you compile a module or run a procedure in Access 2007

This article applies to either a Microsoft Access database (.mdb) file or to a Microsoft Access database (.accdb) file, and to a Microsoft Access project (.adp) file.

For a Microsoft Office Access 2003 or Microsoft Access 2002 version of this article, see 283806 .

For a Microsoft Access 2000 version of this article, see 208218 .

For a Microsoft Access 97 version of this article, see 160870 .


Consider the following scenario. You have a procedure that contains a Microsoft Visual Basic for Applications (VBA) function. The Microsoft Office Access 2007 database or the Access 2007 project contains a reference to a missing object library or to a missing type library. You compile a module, or you run a procedure. In this scenario, you may receive one of the following error messages:
Error message 1
Your Microsoft Office Access database or project contains a missing or broken reference to the file Filename.
* To ensure that your database or project works properly, you must fix this reference.
Error message 2
Compile Error:
Can't find project or library


This problem occurs because at least one object library that is referenced or at least one type library that is referenced is missing or is broken.


To resolve this problem, locate the missing object library, or locate the missing type library. To do this, follow these steps:
  1. In Access 2007, open the database, or open the project.
  2. Click the Database Tools tab, and then click Visual Basic in the Macro group.
  3. In the Visual Basic Editor, click the Tools menu, and then click References.
  4. In the References dialog box, locate the object library or the type library that is displayed as the following:
    MISSING: ReferenceName
  5. Click to clear the check box next to the object library or the type library that you located in step 4.

    Note If you know the location of the missing object library file or the location of the missing type library file, you can click Browse to locate the object library file or the type library file.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

מזהה פריט: 921504 - סקירה אחרונה: 16 באוג׳ 2012 - תיקון: 1