ACC2000: References Not Imported with Objects from Another Database

ID: Q205608


The information in this article applies to:

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

Novice: Requires knowledge of the user interface on single-user computers.


SYMPTOMS

When you import a Microsoft Access object from one database into another database, any reference used by the object is not imported, and you must re-create the reference in the target database. For example, if you insert an ActiveX control on a form, Microsoft Access automatically creates a reference to the .ocx file for that control. If you then open another database and import the form that contains the ActiveX control from the first database, the reference to the .ocx file is not imported with the form. This behavior also occurs when you export an object.


CAUSE

A reference is not imported or exported with an object because it is not specific to the object; instead, a reference is specific to the project of a database.


RESOLUTION

To re-create the reference, you can use one of the following two methods. You can re-create the reference by adding the library file or .ocx file to the Available References list (Method 1). Or, you can re-create a reference to an .ocx file by inserting the corresponding ActiveX control on a form (Method 2).

Method 1

To add the library file or .ocx file to the list of available references in the target database, follow these steps:
  1. In the target database, open a new module in Design view.


  2. In the Visual Basic Editor on the Tools menu, click References.


  3. In the References dialog box, scroll down the Available References list and select the check box for the library file or .ocx file to which you need to re-create the reference. If the file doesn't appear on the list, click Browse, locate the file in the Add Reference dialog box, and then click OK.


Method 2

When you insert an ActiveX control on a form, Microsoft Access automatically creates a reference to the .ocx file that corresponds to the control, even if you don't save the form. This method is useful if you do not know the name of the .ocx file of the ActiveX control. To re-create a reference to the .ocx file of an ActiveX control, follow these steps:
  1. In the Database window, click Forms under Objects, and then click New.


  2. In the New Form dialog box, click Design View, and then click OK to create a new form.


  3. On the Insert menu, click ActiveX controls.


  4. In the Insert ActiveX Control dialog box, click the ActiveX control to which you want to create a reference. Then click OK.


  5. On the File menu, click Close. When prompted to save the form, click No.



MORE INFORMATION

By default, a new Microsoft Access database contains references to the following libraries:

Steps to Reproduce Behavior

  1. Start Microsoft Access and open the sample database Northwind.mdb.


  2. In the Database window, click Forms under Objects, and then click New.


  3. In the New Form dialog box, click Design view, and then click OK to create a new form not based on any table or query.


  4. On the Insert menu, click ActiveX controls.


  5. Click Microsoft ListView Control, version 6.0 on the list in the Insert ActiveX Control dialog box, and then click OK.


  6. On the File menu, click Save. In the Save As dialog box, type frmRefTest in the Form Name box. Click OK.


  7. On the File menu, click Close to close the form.


  8. In the Database window, click Modules under Objects. Click New.


  9. In the Visual Basic Editor on the Tools menu, click References. In the References dialog box, note that the check box for the Microsoft Windows Common Controls is selected. Click Cancel.


  10. On the File menu, click Close and Return to Microsoft Access. Click No if you are prompted to save the module.


  11. On the File menu, click Close to close Northwind.mdb.


  12. On the File menu, click New.


  13. In the New dialog box, click the Database icon on the General tab. Click OK.


  14. In the File New Database dialog box, accept the default database name that appears in the File Name box, and then click Create.


  15. On the File menu, click Get External Data, and then click Import.


  16. In the Import dialog box, locate the sample database Northwind.mdb and double-click it.


  17. In the Import Objects dialog box, click the Forms tab, click frmRefTest in the list of forms, and then click OK.


  18. In the Database window, click Modules under Objects, and then click New to create a new module.


  19. On the Tools menu click References. Note that there is no reference to the Microsoft Windows Common Controls. Even if it appears in the list, its check box is not selected.


Additional query words: library libraries olb tlb


Keywords          : kbdta IntpCstm 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999