As you’ve been working through the import examples in this chapter, you’ve no doubt realized that there can be quite a few steps involved in completing an import procedure. For a one-time operation, this might not seem like a time-consuming task. But, what if your import procedure steps are fairly complex and you need to perform the same import task on a regular basis? Access 2010 includes a feature that allows you to save your import procedures and run them again at a later time. If you’re running the same import procedure on a regular basis, you can even set up a reminder task in Outlook 2010 from Access to remind you to perform the task.
To save an import procedure, you first need to create one. For this example, let’s import the tblEmployees table object from the Housing Reservations database into a new empty database file. Take the following steps:
Create a new empty blank database and then 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, previously shown on Importing dBASE Files. Select the folder where you installed the sample files, select the Housing.accdb file, click Open, and then Click OK.
Access opens the Import Objects dialog box, previously shown on Importing Access Objects, which provides tabs for each of the object types in the database you selected. Click the Tables tab for the object type, select the tblEmployees table, and then click OK to import the table into your database.
After the import process is complete, Access displays the last page of the wizard, as shown in Figure 8-65. A message at the top of this page indicates whether the import process was a success or if any problems were encountered. The wizard also displays an option to save your import steps in case you want to perform the exact import procedure again in the future. Select the Save Import Steps check box and Access shows additional information on this dialog box.
In the Save As text box, you can define a name you want to use to identify this specific import procedure. By default, Access lists the word Import, followed by a hyphen, and then the name of the database file. In the Description text box, you can provide a brief description of the import procedure if you want. Providing a description can be very useful if, in the future, you or someone else need to understand more details about the import procedure. Select the Create Outlook Task check box, cleared by default, and Access creates a new Outlook task to remind you to run this import procedure. If you have already saved import procedures for this database, you can click the Manage Data Tasks button to open a dialog box listing all the previously saved imports. (We’ll discuss that dialog box in just a moment.) Click Save Import to finish importing the tblEmployees table into your database and close the dialog box.
In Figure 8-66, you can see an example of the Outlook task that Access creates when you select the Create Outlook Task option, shown previously in Figure 8-65. You can click Recurrence if you want to set this task to be recurring and have Outlook remind you to run this import procedure. You can also click the Run Import button in the Microsoft Access group on the Task Ribbon to run the saved import procedure from within Outlook.
To see a list of your saved import procedures in Access, click the Saved Imports button in the Import & Link group on the ribbon. Access opens the Manage Data Tasks dialog box, as shown in Figure 8-67. The Manage Data Tasks dialog box has two tabs—Saved Imports and Saved Exports—both of which function exactly the same. Access displays a list of import procedures on the Saved Imports tab and a list of export procedures on the Saved Exports tab in this database.
Figure 8-67. The Manage Data Tasks dialog box lists any saved import or procedures in your database.
In Figure 8-67, you can see the name of the import procedure you saved previously. If you want to change the name of this import procedure, click the name and Access displays a text box where you can edit the import name. Access displays the file path to the database you imported the tblEmployees table on the right side of the screen. Beneath the file path, Access displays any description you provided on the last page of the import wizard dialog box. If you did not define a description for your import procedure, Access displays Click Here To Edit The Description, under the file path. Click it and Access displays a text box for you to enter a description for your import procedure. You can also edit any existing text in this text box.
Click Run, and Access performs the highlighted import procedure. Click Create Outlook Task, and Access creates a new Outlook task for this import procedure. Click Delete, and Access deletes the highlighted import procedure. (Access prompts you for confirmation before deleting the import procedure.) Click Close to dismiss the Manage Data Tasks dialog box.
You cannot edit the individual import steps you saved when you went through the import wizard steps. If you need to change one or more of the import procedure steps, perhaps to use a different file for import, you need to walk through the pages of the import wizard again and save your new import procedure.
Now that you know how to build tables, modify them, and import and link them, it’s time to move on to more fun stuff—building queries on your tables—in the next chapter.