MS Access

Database Object Management

The Paste Table As dialog box
Right-click any database object to open a shortcut menu that lists different commands related to the object.

Not only can you view, open, and modify database objects (tables, queries, forms, etc.) from the Database window, you can also use it to cut, copy, paste, delete, and rename database objects.

  1. Make sure you have the Database window open and click the Tables icon in the Objects bar.

    One reason to copy a database object is that it's often easier to copy and use the design of an existing database object than it is to create a whole new object from scratch. For example, you might copy an Employees table so that you could create a new table using its structure.

    You can use standard cut, copy, and paste procedures on any Microsoft Access database object in the Database window. That's rightthe same cut and paste stuff you already know how to do with text works with tables, queries, forms, pages, and reports!

  2. Select the Employees table and click the Copy button on the toolbar.

    On the surface nothing appears to happen but Microsoft Access has copied the Employees table to the Windows clipboard. Move on to the next step and paste the copied Employees table.

  3. Click the Paste button on the toolbar.

    The Paste Table As dialog box appears, as shown in Figure. First you have to specify a name for the new table.

  4. Type Fired Employees in the Table Name box.

    You have several options when you paste a table objectyou can paste the:

    • Structure Only: Pastes only the structure or design of the table.

    • Structure and Data: Pastes the structure of the table and its data.

    • Append Data to an Existing Table: Adds the copied records to an existing table in the database.

    For this exercise we only want to paste the structure of the Employees table.

  5. Select the Structure Only option and click OK.

    Access pastes the copied Employees table as a new Fired Employees table.

    Note: You can also copy objects from one database to another using simple copy and paste commands. Copy the database object, start another session of Microsoft Access, and open the destination database. Click the Paste button to paste the copied object into the other database.

  6. Double-click the Fired Employees table.

    Notice that there aren't any records in the Fired Employees table because you specified that you only wanted to copy the structure of the Employees table.

  7. Close the Fired Employees table.

    You can also rename a database object from the Database window. Here's how:

  8. Right-click the Fired Employees table, select Rename from the shortcut menu, type Previous Employees and press Enter.

    The "Fired Employees" table is now named "Previous Employees." Finally, here's how to delete any database object.

  9. Select the Previous Employees table and press the Delete key. Confirm the deletion by clicking Yes.

Whenever you're unsure or curious about what you can do with a database object, try right-clicking it. A shortcut menu, as shown in Figure, will appear with a list of commands related to the database object. Following table contains some of the commands you'll see on the database object shortcut menu.

Intermediate and advanced Access users use a standard naming convention to make it easy to identify database objects. You are strongly encouraged to use the following naming convention as well, as it makes it easier to refer to database objects in expressions, macros, and VB procedures.

Object Prefix Example

Table

tbl

tblSales

Query

qry

qrySales

Form

frm

frmSales

Report

rpt

rptSales

Page

dap

dapSales

Macro

mcr

mcrSales

Module

bas

basSales


Object Shortcut Menu Commands
Commands Description

Open

Opens the selected object.

Design View

Opens the selected object in Design view so that it can be modified.

Print

Sends the selected object to the default printer.

Print Preview

Displays how the selected object will appear when it is printed.

Cut

Cuts/moves the selected object to the Windows clipboard.

Copy

Copies the selected object to the Windows clipboard.

Save As

Saves the selected object to a new object within the current database.

Export

Exports the selected object to another Access database or to a different file format.

Send To

Sends the selected object to an e-mail recipient via Microsoft Outlook.

Add to Group

Adds the selected object to Favorites or a new group.

Create Shortcut

Creates a shortcut on the Windows desktop to the selected object.

Delete

Deletes the selected object.

Rename

Renames the selected object.

Properties

Displays the properties and settings for the selected object.


TO CUT/COPY AND PASTE A DATABASE OBJECT:

  1. SELECT THE DATABASE OBJECT.

  2. CLICK THE CUT BUTTON ON THE TOOLBAR.

    OR...

    CLICK THE COPY BUTTON ON THE TOOLBAR.

  3. CLICK THE PASTE BUTTON ON THE TOOLBAR, ENTER A NAME FOR THE NEW OBJECT, AND CLICK OK.

TO RENAME AN OBJECT:

  • RIGHT-CLICK THE OBJECT, SELECT RENAME FROM THE SHORTCUT MENU, AND ENTER A NEW NAME FOR THE OBJECT.

TO DELETE AN OBJECT:

  • SELECT THE OBJECT AND PRESS THE DELETE KEY.