Chapter 2. Tables

Main Operations

Create and save a table and specify fields with their data types

The first step to a database is to create the tables that are needed. You can design a table from scratch or you can activate the Table Wizard which allows you to choose formats that have been pre-defined and are available to use.

To do this click on the Tables icon on the left hand side of the screen (Figure 9).

Figure 2.1. Tables

Tables

If you choose to Create Table in Design View, the following screen will appear (Figure 10).

Figure 2.2. New Table in Design Mode

New Table in Design Mode

Here you enter the field names underneath each other as per the example in Figure 10. The green arrow shows the active row. You can specify a Field Type in the next column which can be either a Text field or a Date, Time, Number, various types of Integer etc. If you do not specify a Field type it will default to Text.

If you look down at the Field Properties below you will see other options that are available, eg if Entry is required for that field. This is so that you can force the person who will be capturing the data into the table to enter information. If no information is entered you will not be allowed to continue until something has been entered.

Add, delete records in a table

Once you have decided on the fields that a table will contain you will need to enter the records. In a table containing information about customers names and addresses each customers information is one record. For example.


                CustomerID = JD001
                Name = JD Wholesalers
                Address = 1 Loop Street
                Town = Cape Town
                PostalCode = 8001
                TelNo = 408 9999
                

This is one record for the customer JD Wholesalers – it contains all details pertaining to that company. The record is made up of five fields, Name, Address, Town, PostalCode, TelNo. Of course this is an example so you would probably have more fields than what have been used here.

Once you have entered this information you will have entered a record.

To enter the information click in the cell below the first field (as you would when entering data into a spreadsheet). Type into the cell. Move to the next cell by using the arrows on the keyboard or by using your mouse and enter the information for each field until it is complete.

Add a field to an existing table

Once you have created a table you may find that you wish to add another field at a later stage. This you do by right-clicking on the table name and choosing Edit. If you want the field at the end then simply click in the row underneath the last field and enter the new field. Click on the Save button to save the change. If you forget to save the table you will prompted to do so when you close it.

If you want the new field to appear within the current fields, ie not at the end, then click on the grey button to the left of the field that you want to be after the new field and right click. A pop up menu will appear allowing you to choose to insert rows (Figure 11). Click on Insert Rows and you have a new row in which to enter your field.

Figure 2.3. Table PopUp Menu

Table PopUp Menu

Add, modify data in a record

Once the records have been entered into the table it may be necessary to change it. Right-click on the table name and choose Open.

Click on the field you want to change and type in the new information. (Figure 12)

Figure 2.4. Update an existing record

Update an existing record

Delete data in a record

To delete a record right click on the table name and choose Open. Click on the grey button next to the record you want to delete and right-click to activate the pop up menu. Click on Delete and the record will be deleted.

Use the undo command

If you make a mistake you can click on the Undo button or you can click on Edit > Undo Data Input.

Navigate within a table to next record, previous record, first record, last record, specific record

You can navigate within the table to various records. There are two ways of doing this. By using the Find Record button on the toolbar

or by using the Table toolbar at the bottom of the screen (Figure 13)

Figure 2.5. Navigate to another record

Navigate to another record

If you click on the first arrow with the line to the left of the arrow it will take you to the first record. The button next to that (left arrow) takes you back 1 record, ie if you are on record 3 and you click this arrow you will go to record 2. The next button (right arrow) will take you one forward, ie if you are on record 3 you will go to record 4. The last arrow with the line to the right will take you to the very end.

Delete a table

Click on the table and right-click to activate the popup menu. Choose Delete. You will be asked to confirm the deletion. Be careful when choosing that you really want to delete the table.

Save and close a table

When you are designing a table make sure you click on the save button as you make changes. When you are finished click on the close button (X). If you have not yet saved you will be prompted.