2. CREATING TABLES

2.1 Using Design View To Create Tables

In this section we will step through the process of creating a table. From the web page for these notes download and open the MyUniversity Database.

      • Click on the Create tab – use the mouse and click it to see the options available (Table, Table Design, SharePoint Lists, etc.):
image
                                      Figure 2.3: Create a table using Table Design
      • Click the Table Design option to begin a process to create a new table, the Department table. You are presented with a form where you can enter field definitions for a table. A field definition comprises field name, data type, and description. You can also set the table’s primary key. The Table Design form is shown below:
image
                                                            Figure 2.4: Table Design View
      • Begin by entering each field name and choosing Short Text as the data type. In the description column you may enter a longer description of the field’s contents – these are treated as comments that may be useful for someone who is learning about your tables. Once you have done this you should have a form that looks like:
image
                                                   Figure 2.5: Department Table
      • Next, we set the primary key for the table to be the deptCode field. Right-Click the mouse in the spot just to the left of deptCode and then click the Primary Key. Access uses an icon to show the deptCode as the PK:
image
                                              Figure 2.6: Setting the Primary Key
      • At this point you should save your work by clicking the Save icon in the upper left- hand corner of the form – you will be prompted to give the table a name – name it Department.

 

You should still be in Design View for the Department table. Note that you can press the F1 function key to get help pertinent to the location of the mouse cursor. If your cursor is positioned on a Field Name and you press F1 you will see a window pop open that displays suggestions from MS Access regarding how you should name fields. Try this. Before going any further, try pressing F1 in other locations too, such as Data Type and Description. We recommend that you read some of the information available to become more familiar with MS Access.

License

Share This Book