0% found this document useful (0 votes)
13 views8 pages

M 1 ICT Lesson 9

The document provides a detailed guide on creating forms and queries in a database using MS Access. It explains how to create a form for entering student grades and how to design queries to retrieve specific data based on criteria. Additionally, it includes evaluation questions and homework assignments related to the topics discussed.

Uploaded by

Mona Hakim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views8 pages

M 1 ICT Lesson 9

The document provides a detailed guide on creating forms and queries in a database using MS Access. It explains how to create a form for entering student grades and how to design queries to retrieve specific data based on criteria. Additionally, it includes evaluation questions and homework assignments related to the topics discussed.

Uploaded by

Mona Hakim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Date / / .

Ninth Lesson
Form and queries

First: Form in database

 It is a graphical interface designed specifically to interact with data stored in the


database.
 It is a screen that displays specific information from the database
 Allows the user to enter, modify or delete this information in an organized and
convenient way.

Create a form

A new form can be created under the name "Enter Student Grades" using the Form
Wizard
Example: To create a form from the current table "Student Grades"
1-Click on the table name "Student Grades" in the Navigation Pane on the left of the
screen, and the data for the "Student Grades" table will appear on the right of the
screen.
2- Choose the Create tab.
3- Click Form.
2
3

The Access program creates the form, and through the form the data for each
student‟s record is displayed individually, as in the following figure:

1
1. The current window is called Layout view, where the data of the first record is
displayed.
2. Click on the "Next record" icon to display the data of the next record.
3. Click on the "Last record" icon to display the data of the last record.
4. Click on the "First record" icon to display the data of the first record.

4 2 3 1

Note that:

• The form is used to enter and modify data in the "Student Grades" table.

• All data entered through the form appears in the "Student Grades" table.

• Data can be entered through the data table or through the form.

• There are several other ways to create a form in an Access desktop database.

Second: Queries in databases:

 "Queries are tools used to obtain data from the database according to "specific
criteria or conditions",
 Through the query, information can be obtained from the database based on the
data stored in the database.

2
Create a new query using the "Query Design"
method
Access provides many methods that allow you to create a query

 Using the Query Design view, which is the method that we will discuss and is
appropriate for what is required to be created.
 When using the Query Design method, you can have greater control over the
details of the query design.

Steps to create a new query using the Query


Design method:method
1-Choose the Create tab

2- Click on Query Design.

3- The following screen appears:

1
2

4- Select the data source table to be used, which is "Student Grades".

5- Click Add, then Close.

The "Design View" window will appear, which is divided into two parts, the upper part
contains the data source table, and the lower part is the query design grid

Data source table

Design grid

Now you are required to create a query:

3
 It shows the names of all students and the subjects grade only for each student.
 In this query we will deal with the fields of the "Student Grades" table:
 To do this, the field names are listed on the query design grid

Add a field to the design grid


method:method
A. Use the drag and drop method for the field name.
B. Drag the field from the data source table in the upper part of the "Query
Design" window to the design grid.
C. When you add a field by drag and drop in the design grid, Access automatically
fills the Table row in the design grid with the name of the table used "Student
Grades", to show the data source of this field.

Execute the query:

- On the Design tab


- Click on the Run icon in the Results group.

- The query result appears in the form of a table, showing all student data.

4
Hide a field or fields from the query
result:
 To hide one or more fields from the query result.
 From the "View" menu, choose "Design View"
 The query design window will appear.
 Click on the ✓ sign in the check box in the Show row in the design grid below the
columns Science score.
 The sign will be removed, which means hiding the field/fields in the query result.

 Click on the Run icon in the Results group and the result will appear as follows:

Establishing criteria or conditions within the query:


- The Criteria in a query helps you to identify specific items in an Access database.
- If a record matches all the criteria you entered in the query grid, the record will
appear in the query results.

5
How to add Criteria or Conditions in a Query:?

To add Criteria to a query, you must:


 Open the query in Design View.
 Type the criterion or criteria in the Criteria row.

For example:
You are required to create a query to show only the data of the student Nada's record,
steps: -
 Type the search criterion ="Nada "in the "Student Name" column in the Criteria
field.
 We write the condition in the column of the field "Student Name", and in the row
Criteria.

 Execute the query, the student record or records that meet the criterion or
condition are displayed.

6
Questions
Q1 : Put (  ) or ( X )

1. The form is a graphical interface designed to interact with data stored in the

database. ( ).

2. We use the form to enter, modify or delete this information in an organized and

convenient way. ( ).

3. A new form can be created under the name "Enter Student Grades" using the Form

Wizard. ( ).

4. All data entered through the form does not appear in the "Student Grades" table. ( ).

5. Data can be entered through the data table or through the form. ( ).

6. There are several other ways to create a form in an Access desktop database. ( ).

7. We use the Query Design view to display the query results. ( ).

8. The Query Design View window is divided into three parts. ( ).

9. The Query Design window is divided into two parts; the upper part is the query design

grid. ( ).

10. The Query Design window is divided into two parts; the lower part is the data source

table. ( )

7
Ministry Evaluation ( Week 12 )

Homework
1. To design a costume graphical interface to interact with the data stored in the
database we use.............
A- Form B- Query
C- Tables D- Reports
2. To create a form student grade table in your database select ................from Create
tab.
A- Design B- Form
C- Blank. D- Query
Class Evaluation
 Open MS Access application

 Open the database called ”Student Results.

 Create a Form and use it to enter student’s marks to the data table.

Ministry Evaluation ( Week 13 )

Homework
1. To obtain data from database according to a specific condition, we use.............

A- Form B- Table

C- Query D- Data source

2. When using the .................... method, you can have greater control over the details

of the query design.

A- Query wizard. B- Form design

C- Report design. D- Query design.

Class Evaluation
 Open MS Access application

 Open the database called ”Student Results.

 Create Query to display subject marks for one of the students.

You might also like