Flylib.com

Books Software

 
 
 

Lesson 5. Creating a Table from Scratch

Team-Fly    

  
10 Minute Guide to Microsoft Access 2002
By Joe Habraken
Table of Contents


Lesson 5. Creating a Table from Scratch

In this lesson, you learn how to create a table in the Table Design view and the Datasheet view.


Team-Fly    
Top
 

Team-Fly    

 
10 Minute Guide to Microsoft Access 2002
By Joe Habraken
Table of Contents
Lesson 5.  Creating a Table from Scratch

Creating Tables Without the Wizard

Although the Table Wizard provides an easy method for quickly creating tables, it does not provide you with complete control over all the aspects of creating the table. It does allow you to select the fields used in the table from a set list, but it restricts you to only those predefined fields (there are also several types of fields, each used for a different data type). Creating tables from scratch in the Design view allows you to build the table from the bottom up and gives you complete control over all aspects of the table's design.

Plain English

Design View This view allows you to enter field names , select the data type that a field will hold, and customize each field's properties. A Design view is available for all the Access objects, including tables, forms, queries, and reports


The Design view isn't the only way to create a table from scratch in Access. You can also create a table in the Datasheet view by labeling your field columns directly on the table's datasheet, which is similar to creating a worksheet in Excel. Take a look at both methods for creating a new table.

Tip

Datasheet View This view places each record in a separate row and each field in a separate column (column headings are provided by the field names). This view is used to enter data directly into the table. You will use the Datasheet view whenever you want to view the records in the table or add or edit records.



Team-Fly    
Top
 
Team-Fly    

 
10 Minute Guide to Microsoft Access 2002
By Joe Habraken
Table of Contents
Lesson 5.  Creating a Table from Scratch

Creating a Table in Table Design View

When you create a table in the Design view, you are creating the structure for the table; you create a list of the fields that will be in the table. You also select the data type for each field. (Fields can hold text, numbers , even graphicsyou learn the types of fields that can be created later in this lesson.) You also have the option of entering a description for each field. Field descriptions are useful in that they provide a quick summary of the type of data that goes into the field.

Another issue that relates to creating a table in the Design view (or editing a table's structure in the Design view) is that any changes you make must be saved before closing the table. If you have worked in other applications, such as Word or Excel, you might think that saving your work is just common sense. However, when you actually start working on entering data into a table or a form, Access automatically saves your records as you enter them. Therefore, in Access, you need to remember to save only the changes that you make to the structure of a table, form, query, or report. You learn more about this in Lesson 6, "Editing a Table's Structure."

Tip

Field Naming Rules Field names in Access can be up to 64 characters long and can contain spaces and both alphanumeric and numeric characters. You can't use periods or exclamation points in your field names. Also, avoid special characters (such as $, %, or #) in field names because some of these characters have special meanings in Access code.


To create a table in Table Design view, follow these steps:

  1. In the database window (of a particular database) click the Tables icon if necessary, and then double-click Create Table in Design View . The Table Design view opens (see Figure 5.1).

    Figure 5.1. The Table Design view allows you to create the structure for your table.

  2. Be sure that the insertion point is in the first row of the Field Name column. Type the -field name for the first field in your table. Then, press Tab or Enter to move to the Data Type column.

  3. When you move tothe Data Type column, an arrow appears for a drop-down list. The default data type setting is Text; several other data types are available, such as AutoNumber, which automatically numbers each of your records. This field type is excellent for customer number fields or employee ID fields. Click the Data Type drop-down list and select a field type. The different data types are discussed later in this lesson, in the section "Understanding Data Types and Formats."

  4. After selecting the data type, press Enter to move to the Description column; type a description for the field. (This is optional; the table will work fine without it.)

Tip

Deleting a Field Ifyou enter a field and decide that you don't want it in the table's structure, select the field (its entire row) and press the Delete key.


  1. Enter other fields and their field types (descriptions are optional) as needed. Figure 5.2 shows the structure for a table that will be used to enter product information.

    Figure 5.2. A table's structure consists of several fields; fields may differ by field type.


Team-Fly    
Top