Sunteți pe pagina 1din 13

By the end of this section of the practical, the students should be able to: Creating a new database Create

and inserting data into table Creating a form using the Form Wizard Generate a report using the Report Wizard

Introduction

Microsoft Access is one the Database Management Software (DBMS) available from Microsoft. It provides a range of functionality as needed to create a database application such as Students Database. There are several terms that you should familiarize with. The terms that you need to know are Table, Forms, Queries and Reports. Refer notes for details.

1.1 Step by Step


In this lab, you are required to create a simple new database for student. It will be only include one table that is Student. It will contain the information of student.

1.1.1 Creating a New Database 1. Open Microsoft PowerPoint. Select All Programs Microsoft PowerPoint.

2. A dialog box will appear as below.

3.

There are three options; creating new database using blank, creating new database using wizards and opening an existing file.

4. 5. 6.

As for this example, select creating new database using Blank Access Database. Click OK. Then, a window will appear. Define the location to save the file at My Document name the database as Student. Then click Create.

7.

The window of database will be shown.

1.1.2 Creating A Student Table

Before you want to create the table, you should identify what information that you want to save in that table. As for this lab, Student table should have the studentID, name, gender, contact number, date of birth and CGPA result.

1. 2.

Double click at Create table in Design view. The Table Design window will appear as below.

3.

There are three columns in this window. You have to define the field name and data type. As for description, it is optional. Default value for data type is text. To change the value, click at the arrow to open the drop down menu and select the new value.

4.

Enter the data as shown in the figure.

1.1.3 Defining Primary Key

The primary key is used to make the value unique between each field. It is needed to identify and retrieve a record that we want to. As in this lab, the primary should be studentID because it is unique from each student.

1. 2.

Click at studentID field. You may find the key button from the tool bar OR right mouse click and select Primary Key.

3.

The key symbol will appear to the left of studentID field. Only one primary key allowed to be defined. Please choose an appropriate primary key.

4.

After finished, close the table design window. You will be asked to save the table. Save it as Student.

1.1.4 Design View and Data View

2 1.

1 Design View y Allows user to modify the table design.

2.

Data View y Allows user to enter data into the table.

1.1.5 Entering Data into Table (Data View)

1. 2.

Select Data View OR double click at Student table. Then, the student table will appear. You may change the column width by dragging the divider of the column.

3.

Enter the data into the related field based on the example given.

4.

Save and close the Student table.

1.1.6 Creating A Form

Forms provide users a graphical method of entering and updating data into the database. It is because the users may not directly involved handling the data in the database. This method simplifies the way of data entry and retrieval, while ensuring unauthorized database access.

Forms may be created using Form Wizard and Design View. As in this lab, we will be using the Form Wizard.

1.

Select Forms in the left window as shown below.

2. 3.

Double click at the Create form by using wizard. A Form Wizard window will appear.

i
ii iii

i)

Table/Query drop down menu allows user to choose field from different table or query.

ii)

The Available Fields listing the field that available form the table or query selected.

iii)

The Selected Fields is the listing of the chosen field from user.

4.

Click at the Table/Query drop down menu and select the appropriate table or query. In this lab only Student table is available to select.

5.

Select all of the available field by clicking at Alternatively, you may individually select

. and deselect the field.

6.

Click Next. Select the form of layout as Columnar.

7.

Click Next. Select a style to apply. In the example is Standard.

8.

Click Next. Enter the title of form as Students.

9.

Select Open form to view or enter data.

10.

Click Finish.

1.1.7 Using a Form

Record selector is provided at the bottom of the form. It is used to navigate through the records and add new record.

Go to first record

Go to next record

Go to last record

New record

Number in the window indicates the number of current record. As in the figure record shown is record number 1 out of 5 record.

1.1.8 Entering Data

1. 2.

From the record selector, select new record button Enter the data of student into the new record. The data that is entering using the form will be also updated into the table.

3. 4. 5.

Try to enter the data of existing student. What happen? It is not allowed because the primary key is redundant. Close the Students form by clicking at .

1.1.9 Creating A Report

Report may be created using Report Wizard and Design View. In this lab, we are using the Report Wizard.

1. 2.

Select Records in the left window as shown above. Double click at the Create report by using wizard.

3.

A Report Wizard window will appear.

4.

Select The Available fields from Student table to the selected fields. You may select only interest field that you want to be printed. As in the example, all fields are selected except for gender and dateofbirth.

5.

Click Next. The selected field may be grouped into level of precedence. In this example we use the initial order.

The records in the generated report can be assorted in ascending or descending order for up to four fields. In this example, record is sorted by CGPA and then on Name. 6. Click on the drop down menu to select the field. The default order is ascending (A-Z) can be change to descending (Z-A). 7. Click Next. Now you need select the report layout.

8.

Use the default value that is columnar and portrait for the orientation.

9. 10. 11.

Click Next. Select the style of the report as Corporate. Click Next. Enter the report name as Student. Click Finish.

12.

The report is created and viewed for you. Then, you have to modify the report in Design View.

1.1.10 Editing the Report

1.

Click at Design View button.

2.

2.

Design View breaks the report into four sections. Report Header: Appear in the first page of report. Contain the title of report Page Header: Contain the column names and line Detail: Contain the details of the column name Page Footer: Contain current date and time and also page number.

3.

Alter the size and space between each item by clicking at each of small black square.

4.

Delete any item that is not needed. For example you do not want the date to be printed. You may simply delete the =Now().

5.

After done with editing, view the report. Click at preview button

6.

The report should be edit and the result should be the same as in the example.

1.2 Self Review Questions


1. How to defined the data type of information that entered in the field?

2.

Why we need to define primary key?

3.

What is the difference between creating table in design view and creating table by using wizard?

4.

What is the usage of field description column in table design view?

5.

Describe the use of report in the database.

6.

Access provided two views that are design view and data view. What is the usage of these two views.

S-ar putea să vă placă și