ACC2000: VBA Functions Break in Database with Missing References
ID: Q208218
|
The information in this article applies to:
-
Microsoft Access 2000
-
Microsoft Excel 2000
-
Microsoft Word 2000
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
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:
- Open your database.
- Press ALT+F11 to switch to the Visual Basic Editor.
- Open a module in Design view.
- On the Tools menu, click References.
- 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.
MORE INFORMATION
Steps to Reproduce Behavior
- Open the sample database Northwind.mdb.
- Create a new form.
- On the Insert menu, click ActiveX Control.
- In the Select an Activex control list, click Microsoft Forms 2.0 ToggleButton, and then click OK.
- Save the form as frmReference, and then close it.
- Close Northwind.mdb and quit Access.
- Find and rename the Fm20.dll file to Fm20.xxx.
- Start Access and open Northwind.mdb.
- Open the module named Startup in Design view.
- On the Debug menu, click Compile Northwind. Note that you receive the error message described in the "Symptoms" section.
- 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
- Click Cancel in the Available References dialog box.
- Find and rename the Fm20.xxx file to Fm20.dll.
- Repeat step 10 and note that the error message no longer appears.
Additional query words:
Now Time Date Left Right Mid Str Format Trim LTrim RTrim prb
Keywords : kbdta MdlLib
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb