Manipulating Tables in a Database Window

As you create many tables in your database, you may want to use them in other databases or copy them for use as a history file. You may want to copy only the table structure. You can perform many operations on tables in the Navigation pane, including

  • Renaming tables

  • Deleting tables

  • Copying tables in a database

  • Copying a table from another database

You perform these tasks by direct manipulation or by using menu items.

Renaming tables

Rename a table with these steps:

1.
Select the table name in the Database window.

2.
Click once on the table name, and press F2.

3.
Type the new name of the table and press Enter.

You can also rename the table by right-clicking on its name in the Navigation pane, and selecting Rename from the shortcut menu. After you change the table name, it appears in the Tables list, which re-sorts the tables in alphabetical order.

Caution

If you rename a table, you must change the table name in any objects where it was previously referenced, including queries, forms, and reports.


Deleting tables

Delete a table by selecting the table in the Navigation pane and pressing the Delete key. Another method is by right-clicking a table and selecting Delete from the shortcut menu. Like most delete operations, you have to confirm the delete by selecting Yes in a confirmation dialog box.

Copying tables in a database

The copy and paste options in the Clipboard group on the Home tab allow you to copy any table in the database. When you paste the table back into the database, you choose from three option buttons:

  • Structure Only

  • Structure and Data

  • Append Data to Existing Table

Selecting the Structure Only button creates a new table, empty table with the same design as the copied table. This option is typically used to create a temporary table or an archive table to which you can copy old records.

When you select Structure and Data, a complete copy of the table design and all of its data is created.

Selecting the Append Data to Existing Table button adds the data of the selected table to the bottom of another. This option is useful for combining tables, such as when you want to add data from a monthly transaction table to a yearly history table.

Follow these steps to copy a table:

1.
Right-click the table name in the Navigation pane.

2.
Choose Copy from the shortcut menu, or choose the Copy button in the Clipboard group on the Home tab.

3.
Choose Paste from the shortcut menu, or choose the Paste button in the Clipboard group on the Home tab.

4.
Provide the name of the new table.

5.
Choose one of the Paste options (Structure Only, Structure and Data, or Append Data to Existing Table).

6.
Click OK to complete the operation.

Figure 34-20 shows the Paste Table As dialog box, where you make these decisions. To paste the data, you have to select the type of paste operation and type the name of the new table. When you are appending data to an existing table, you must type the name of an existing table.

Figure 34-20. Pasting a table activates this dialog box. You can paste only the structure, the data and structure, or the data to an existing table.


Copying a table to another database

Just as you can copy a table within a database, you can copy a table to another database. There are many reasons why you may want to do this. Possibly you share a common table among multiple systems, or you may need to create a backup copy of your important tables within the system.

When you copy tables to another database, the relationships between tables are not copied; Access copies only the table design and the data. The method for copying a table to another database is essentially the same as for copying a table within a database. To copy a table to another database, follow these steps:

1.
Right-click the table name in the Navigation pane.

2.
Choose Copy from the shortcut menu, or choose the Copy button in the Clipboard group on the Home tab.

3.
Open the other Access database.

4.
Choose Edit Paste from the shortcut menu, or choose the Copy button in the Clipboard group on the Home tab.

5.
Provide the name of the new table.

6.
Choose one of the Paste options (Structure Only, Structure and Data, or Append Data to Existing Table).

7.
Click OK to complete the operation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset