Database an Overview continued…

Default value and validation options are available for many data types. The default value option automatically places a defined value in a given field, which you can then accept or change. This technique eliminates redundant entries for such items as a city or state name. Validation options enable you to specify a rule to be used to verify the accuracy of data entered into a field. The validation rule can also be expressed as a formula (mathematical equation). The Amount field is used to demonstrate these field property options.

Click in the Field name cell below Postcode. Type Amount in the Field Name column, and press Enter.

Click the down arrow of the Data Type box, and then click Currency. Press Enter to move to the Description column. Note that the default value has been automatically set to 0 in the Field Property box (lower section). Although you can set this value by entering a desired default value in its box, use the default setting for this exercise.

In the Description column, type "Amount owed by the customer".

Click the Validation Rule box in the lower section. Note that an ellipsis (…) appears to the right of the box. Clicking this button will open a dialog box for entering your preferences.

Type <=5000 in the Validation Rule box. The formula entered will restrict the value that can be entered in this field to an amount less than or equal to 5000. Press Enter to move to the Validation Text box.

Type "You must enter an amount less than or equal to $5,000.00". This phrase will appear in an error message if a value greater than 5000 is entered into this field.

The structure of the table is complete, save the structure by clicking on the floppy disk icon on the toolbar. You will get a dialog box with the Table name as Table1 highlighted. This is the default name given by Access to the first table made in the Database. Type in Customer List and press OK. The Figure below illustrates this for you. Remember that a table is an Access object, not a file. Saving it makes it part of your Customer Database file.

A dialog box appears, warning you "There is no primary key defined" and asking whether you want to create one. A primary key is a field (or set of fields) that uniquely identifies each record in a table. Assigning a primary key will rearrange records in that order and prevent you from entering records with a duplicate primary key. It is needed in relational database operations. However for now you will skip this option, by clicking on the No button.

You can now close the Table design window and switch the view for data entry. Click on the top right hand corner where the X button is. You are now back in the Database object window. Your Database object window should look like the Figure below, informing you that there is a table in the Database called Customer List. You have the option of viewing the table in design view, or opening it so that you can start entering data. Click on Open.

Continue Next Page

Top of the Page

Previous Page

Opening Page