Vous êtes sur la page 1sur 4

Practical Exercises for CMT400 MS Access 2007

Ex 1: Opening Access, creating table and exiting Access


In this exercise, you will learn how to open MS Access, create a table, insert and delete records,
and finally exit Access.
1. Open MS Access, select Blank database and name the file CMT400Ex.accdb.
2. The screen looks like Fig. 1 below. You will see Table 1 on the left side of the window
which is known as the navigation pane. On the right side is the working where you can
insert field and data. There are two columns: the first column has a field name ID and
next to it is the Add New Field column. (Fig. 1)
3. To insert field names, right-click the Table1 tab and click Design view. If you are
asked to save the table, save it as Table1-Ex1
4. There are four columns. The first column (a small column) has a yellow key in it. This
key is known as a primary key. The ID field name is chosen as the primary key. It
means that each record has unique number just every student has a unique matric no.
The other three columns are Field Name, Data type and Description. Type all the
information as shown in Fig. 1a. In the data type column, click the down arrow to see
more data type options.
5. The Description column explains the data that will entered. Located below the three
columns are the field properties and the explanation of each of these properties is on its
right. We will not change any field properties for now.

Fig. 1

Borhan/CMT400/Access

Fig. 1a
6. Right-click the Table1-Ex1 tab and click Datasheet view. All the field names that you
have entered in design view now become columns and rows like a table just in an Excel
worksheet.
7. Type all the data as shown in Fig. 1c. There are 5 rows and each row contains the same
fields. Each row is known as a record
8. Now delete the last record i.e. no 5 with the name Zakiah. To delete it first move the
mouse pointer to the first column (the small column to left of ID column) until you see a
small black arrow pointing to the right. Click it and the whole row is selected as in
Fig. 1c.

Borhan/CMT400/Access

Fig. 1c
9. Right-click on this row and select delete record. Answer yes to confirm you want to
delete the record. Now you have 4 records left.
10. Insert a new record by typing a new student name e.g. Sharifah. Notice that as you type
the name, the ID automatically gives no 6 to this new record. Notice also that you now
have 5 records but there is no ID number 5. The reason is that no.5 record is unique, it is
only for Zakiah, the name or record that you have deleted just now.
11. There are two ways to close Access. See Fig. 1d. Before you exit save all open tables.

Borhan/CMT400/Access

To close Access click either


one

Fig. 1d

Borhan/CMT400/Access