Database an overview continued…
The upper section of the Table Design window is where you define field names and the type of data the fields will hold. The lower window tabs let you set each field's properties (characteristics). The message area at the lower right of the window displays context-sensitive help. For example, currently, the insertion point appears in the first cell of the Field Name column. The help message is displayed, as shown in the Figure (below) indicates that "A field name can be up to 64 characters long, including spaces." As you move to each area of this window, specific help messages appear to guide you.
A field name identifies the data that will be stored in the field. Field names can contain letters, spaces, numerals, or underline symbols. Whereas spaces may be embedded in a field name (Gross Pay), you cannot begin or end a field name with a space. In addition, do not use a bracket ([or]), an exclamation point (!), a period (.), or the back quote character (`) in a field name.
When you first see the Table Design window, the text insertion point should be in the first row of the Field Name column.
If for some reason it isn't click the first cell below the Field Name column label to move the insertion point there. Type Customer Number and press Tab or Enter. If you make a mistake, press Backspace to erase it. If you've already left the column, press the left arrow key to go back, and then renter the field name. You may also use the Insert or Delete key to help correct errors.
Customer Number appears in the Field Name column, and the data Text now appears highlighted in the Data Type column (Figure 6, next page). You can identify the type of field values (called data type) to be stored in this field. Access has already entered Text as the default type, which is the correct type for this field. Text data consists of strings of characters that have no numeric value, such as a name, an address, a phone number, or a Postcode.
To accept the data type Text and move to the Description column, press Tab or press Enter.
The insertion point is now in the Description column. This entry is optional. It should contain a descriptive line or phrase that describes the contents of the field. This line will be displayed later, during the data entry process, as a guide for you.
For now type in "An identification code for this customer".
You will notice that the lower portion of the Table Design window contains an area where you can describe the properties of the field. One of these properties is already filled in - Field Size.
The size of a text field is, that is the maximum number of characters allowed is under your control. In Access you can use up to 255 characters. To change the size of this field to 3, click after the "50" in the Field Size text box in the lower section. Backspace over the default entry, then type 3 and press Enter. Leave the other properties at their default settings.
To enter the next field, click the Field Name cell in the second row to move the Insertion point there. Type Last and press Enter. Press Enter again to keep the Data Type as Text. Type Customer' s last name in the Description column. Click in the "50" in the Field Size text box in the lower section. Backspace over the default entry and type 15, press Enter.
Because it would be pointless to create a record without a last name, you can instruct Access to "force" the user to enter a last name for every record. This field property is called the Required feature. When the Required feature is activated, the field must contain data in order to create a record. To turn on the Required feature click after No in the Required box in the lower section. Note that a down arrow appears you can use it to switch to Yes. Click the down arrow in the Required box, and then click Yes. This prevents anyone from creating a record that has no last name.
Now create the following five entries according to the table below.
Field Name |
Data Type |
Description |
Field Properties |
Customer Number |
Text |
An identification code for the customer |
Field size = 3 |
Last |
Text |
Customer's Last name |
Field Size = 15 Required = Yes |
First |
Text |
Customer's first name |
Field Size = 10 |
City |
Text |
Customer's city |
Field Size = 20 |
State |
Text |
Customer's state |
Field Size = 3 |
Postcode |
Text |
Customer's four digit postcode |
Field Size = 4 |
Amount |
Currency |
Amount owed by customer |
Default value = 0 Validation Rule = <=5000 Validation Text = "You must enter an amount less than or equal to $5,000" |
Click the Field Name cell in the third row to move the insertion point there. Enter the data for the third field using the same techniques. Continue entering the next three field definitions (stop after you complete the Postcode field). The completed upper section should look like the figure below.
Continue Next Page |
Top of the Page |
Previous Page |
Opening Page |