Importing Access Objects
If the database from which you want to import data is another Access database, you can import any of the six major types of Access objects: tables, queries, forms, reports, macros, or modules. To achieve the same result, you can also open the source database, select the object you want, click the Copy command in the Clipboard group on the Home tab of the ribbon, open the target database, and then click the Paste command in the Clipboard group on the Home tab. Using the Import command, however, allows you to copy several objects without having to switch back and forth between the two databases.
To import an object from another Access database, take the following steps:
- Open the Access database that will receive the object. If that database is already open, close any open objects so that only the Navigation pane is showing.
- On the External Data tab, in the Import & Link group, click the Access command. Access opens the Get External Data - Access Database dialog box.
- Click Browse to open the File Open dialog box. Select
the folder and the name of the .accdb, .mdb, .adp, .mda, .accda, .mde, .accde, or .ade
file containing the object that you want to import, and then click Open.
Note Access 2010 provides a database utility to create a compiled version of a .mdb or .accdb desktop application or .adp project file that contains no source code. The compiled versions have .mde, .accde and .ade extensions, respectively. You cannot import forms, reports, or modules from a .mde, .accde or .ade file. - Click OK. Access opens the Import Objects dialog box, which provides
tabs for each of the object types in the database you selected. First, click the tab for
the object type, and then select the specific object you want to import.
If you select an object in error, you can click the name again to deselect it. If you want to import all objects of a particular type, click Select All. You can import multiple objects of different types by clicking each object tab in turn and selecting the objects you want to import.
You can also click the Options button (which was clicked in the preceding illustration) to select additional options. If you import any tables from the source database, you can select the option to import the table relationships (if any) defined for those tables in the source database. If the object is a table, you can select the option to import the table structure (the table definition) only or to import the structure and the stored data. If your source database is an .mdb or .adp file created in a version of Access before 2007, you can select the Menus And Toolbars check box to import all the custom menus and toolbars from your source database. Be aware, however, that these items appear on a special Add-Ins tab on the ribbon, and some of the commands you designed in your custom menus and toolbars might not work in Access 2010. You can also select the Import/Export Specs check box. If you select the Nav Pane Groups check box, Access imports any custom Navigation pane groups you have defined in the database. You can also choose to import a query object (the definition of the query) by selecting As Queries under Import Queries, or you can ask Access to run the query and import the data results into a table by selecting As Tables. Click OK to copy the objects you selected to the current database. - If the import procedure is successful, the new object will have the name of the object you selected. If Access finds a duplicate name, it will generate a new name by adding a unique integer to the end of the name, as explained previously. Because objects such as queries, forms, reports, macros, and modules might refer to each other or to tables you're importing, you should carefully check name references if Access has to rename an imported object.
Note If the source Access database is a secured file created in a previous version of Access, you must have at least read permission for the database, read data permission for the tables, and read definition permission for all other objects to import objects. After you import the objects into your database, you will own the copies of those objects in the target database.
In this tutorial:
- Importing and Linking Data
- Open Database Connectivity (ODBC)
- Creating a Data Source to Link to an ODBC Database
- Importing vs. Linking Database Files
- Importing Data and Databases
- Importing SQL Tables
- Importing Access Objects
- Importing Spreadsheet Data
- Importing a Spreadsheet
- Importing Text Files
- Modifying Imported Tables
- Linking Files
- Linking Access Tables
- Linking dBASE Files
- Linking Text and Spreadsheet Files
- Linking SQL Tables
- Modifying Linked Tables