ACC2000: VBA Functions Break in Database with Missing References

Article translations Article translations
Article ID: 208218 - View products that this article applies to.
This article was previously published under Q208218
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

For a Microsoft Access 97 version of this article, see 160870.
For a Microsoft Access 2002 version of this article, see 283806.
Expand all | Collapse all

On This Page

SYMPTOMS

If you have a procedure that contains a Visual Basic for Applications function, and your database contains a reference to a missing object library or type library, you may receive the following error message when you compile your modules or run the procedure:
Compile Error:
Can't find project or library

CAUSE

Your database contains a reference to a database, type library, or object library that is marked as MISSING: <referencename> in the References dialog box.

RESOLUTION

To remove the missing reference, follow these steps:
  1. Open your database.
  2. Press ALT+F11 to switch to the Visual Basic Editor.
  3. Open a module in Design view.
  4. On the Tools menu, click References.
  5. Click to clear the check box for the type library or object library marked as MISSING: <referencename>.
An alternative to removing the reference is to restore the referenced file to the path specified in the References dialog box. If the referenced file is in a new location, clear the MISSING: <referencename> reference and create a new reference to the file in its new folder.

NOTE: In an Access run-time application, you cannot view references from a menu. However, the following article demonstrates how to view references by using code:
209849 ACC2000: How to Loop Through References to View Their Properties

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.
  2. Create a new form.
  3. On the Insert menu, click ActiveX Control.
  4. In the Select an Activex control list, click Microsoft Forms 2.0 ToggleButton, and then click OK.
  5. Save the form as frmReference, and then close it.
  6. Close Northwind.mdb and quit Access.
  7. Find and rename the Fm20.dll file to Fm20.xxx.
  8. Start Access and open Northwind.mdb.
  9. Open the module named Startup in Design view.
  10. On the Debug menu, click Compile Northwind. Note that you receive the error message described in the "Symptoms" section.
  11. Click OK. Note that the References dialog box appears; the following reference is highlighted in the Available References box:
    MISSING: Microsoft Forms 2.0 Object Library
    					
  12. Click Cancel in the Available References dialog box.
  13. Find and rename the Fm20.xxx file to Fm20.dll.
  14. Repeat step 10 and note that the error message no longer appears.

Properties

Article ID: 208218 - Last Review: June 28, 2004 - Revision: 3.0
APPLIES TO
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Access 2000 Standard Edition
  • Microsoft Word 2000 Standard Edition
Keywords: 
kbprb KB208218

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com