M06-Operate Database Application
M06-Operate Database Application
Level II
Based on March, 2022 Version-I
September, 2022
Addis Abeba, Ethiopia
Table of Contents
Acknowledgment.........................................................................................................................................4
Introduction of module................................................................................................................................5
Unit one: Create database objects.............................................................................................................6
1.1. Introduction to database object.....................................................................................................7
1.2. Creating database object...............................................................................................................8
1.3. Modifying database object..........................................................................................................10
1.4. Create relationship......................................................................................................................12
Self-check 1...............................................................................................................................................14
Operation sheet 1.1: - Modifying database object................................................................................15
Lap test 1....................................................................................................................................................17
Unit Two : Customize basic setting...........................................................................................................18
2.1 Introduction to customizing Access............................................................................................19
2.2 Adjusting page layout.................................................................................................................19
2.3 . Opening and viewing different toolbars....................................................................................21
2.4 Formatting font as appropriate....................................................................................................24
Self-check 2...............................................................................................................................................25
Unit Three: Create reports....................................................................................................................25
3.1. Introduction to report......................................................................................................................26
3.2. Designing reports in a logical sequence or manner........................................................................26
3.4. Modifying reports...........................................................................................................................27
Self-check 3...............................................................................................................................................33
Operation sheet 3.......................................................................................................................................34
Operation sheet 3.1 Produces access database report................................................................................34
Operation sheet 3.2 Produces selected filed data report............................................................................37
Lap Test 3..................................................................................................................................................38
Unit four : Create Database Forms..........................................................................................................39
4.1. Introduction to forms..................................................................................................................40
4.2. Create a simple form...................................................................................................................41
4.3. Open existing database and modify records using a simple modified form...............................52
4.4. Rearranging objects within the form...........................................................................................57
Self-check 4...............................................................................................................................................62
Operation sheet 4.1 Procedures access database form...............................................................................64
DB Database
M06 module 06
WDDBA
Ministry of Labor and Skills wish to extend thanks and appreciation to the many representatives of
TVET instructors and respective industry experts who donated their time and expertise to the
development of this Teaching, Training and Learning Materials (TTLM).
This unit is developed to provide you the necessary information regarding the following content
coverage and topics:
Introduction to database object
Creating database object
Modifying database object
Creating relationship
This unit will also assist you to attain the learning outcomes stated in the cover page.
Specifically, upon completion of this learning guide, you will be able to:
Database objects are components that save and query information. A database contains objects that are
used to store and display large, relational data.
Important Terms and Basic Objects
Now in this Microsoft Access tutorial, we will learn about some important terms and basic objects in
MS Access:
Database File:
It is a file which stores the entire database. The database file is saved to your hard drive or other storage
devices.
Datatypes:
Datatypes are the properties of each field. Every field has one datatype like text, number, date, etc.
Table: - A Table is an object which stores data in Row & Column format to store data.
A Table is usually related to other tables in the database file.
Each column must have Unique name
We can also define Primary Key in a table.
Query: - Queries answer a question by selecting and sorting and filtering data based on
search criteria.
Queries show a selection of data based on criteria (limitations) you provide.
Queries can pull from one or more related Tables and other Queries.
Types of Query can be SELECT, INSERT, UPDATE, DELETE.
Form: - A form is a database object that you can use to create a user interface for a
database application.
Forms help you to display live data from the table. It mainly used to ease the
process of data entry or editing.
Report: -A report is an object in desktop databases primarily used for formatting,
calculating, printing, and summarizing selected data.
You can even customize the report’s look and feel.
Macros: - Macros are simply shortcuts. If you've ever used macros in MS Word or Excel, then
you are already familiar with what they do. You can create a macro to execute a task that you
would otherwise execute with your keyboard or mouse.
Page 7 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
1.2. Creating database object
It is possible to modify the design of your table and fields at any time by going to design view and
making the required changes. However, any changes made after data has been added to the table may
cause loss of data. Changes to field names, data types and properties may also impact on other objects
which are linked to or based on the table.
Adding and removing fields
You can modify the structure of your table by adding and removing fields in design view. Note,
however, that using the cut, paste or delete functions will remove the field and any data in that field.
Selecting fields
To select a field, click on the row selector to the left of the field name. To select multiple fields, click on
the row selector and drag the mouse down the selector symbols to select additional fields. The screen
capture below shows a table with two fields selected.
Deleting fields
1. Select the field or fields to be deleted using the row selector.
2. Press the Delete key on the keyboard, select Delete Rows from the Design tab or right-click on
1. Click in the field above which you wish to insert a new row.
To insert multiple rows, select the required number of rows using the row selector.
2. Select Insert Rows from the Design tab or right click and choose Insert Rows.
Moving fields
1. Select the field or fields to be moved.
2. Click on the selected field(s) and drag the mouse to the new location for the field(s). As you drag, a
bold black line will appear indicating where the fields will be moved to if you release the mouse button.
3. Release the mouse button in the appropriate location.
Helpful hint: Don’t use cut and paste to move fields if you have data in the table as this will delete the
data.
Changing data type
1. If your table contains data, make a backup copy of the table before you change data types or field
sizes.
2. Open the table in design view.
3. Click the data type column of the field you want to change, click the drop down arrow, and select the
new data type.
4. Click the Save button on the Quick Access toolbar.
Helpful hint: If the data type conversion would result in lost values, Access displays a message telling
you that errors occurred during conversion before it actually saves the changes. Click Cancel to cancel
the changes. Click OK to continue and save the changes anyway.
In large tables, changing a Data Types might take a long time. If you want to cancel the conversion
process at any point while it is running, press Ctrl+Break, and then click OK.
Changing field size
If you convert a large field size setting to a smaller one in a field that already contains data, you might
lose data in the field. For example, if you change the field size setting for a text data type field from 255
to 50, data beyond the 50 characters will be discarded.
If the data in a number data type field doesn't fit in a new field size setting, fractional numbers may be
rounded or you might get a null value. For example, if you change from single to integer data type,
A relationship in Access helps you combine data from two different tables. Each relationship
consists of fields in two tables with corresponding data.
Primary key
A primary key is a single field or combination of fields in a table that uniquely identifies each record in
that table. No two records can have the same value in the primary key field or combination of fields.
It is advisable to create the primary key before entering data in a table because Access will prevent
duplicate values being created in the designated field. It is particularly important to set a primary key
when creating relationships between tables as Access uses it to link tables together.
Helpful hint: Records are displayed in primary key order by default.
Setting a primary key
1. Click on the appropriate field name and click the Primary key button on the Design tab.
2. The primary key symbol will appear on the button in the row selector box on the
appropriate row (see the screen capture on previous page).
Setting a multiple field primary key
With a multiple-field primary Key, the combination of the contents of all fields included in the key must
be unique. For example, for a primary key based on the CourseID and CourseDate fields, the same
CourseID and CourseDate combination cannot appear in more than one record.
A foreign key
A foreign key is a field (or fields) in one table that references the primary key in another table. The data
in the fields from both tables is exactly the same, and the table with the primary key record (the primary
table) must have existing records before the table with the foreign key record (the foreign table) has the
matching or related records. Like primary keys, you can define foreign keys in the table declaration by
using the CONSTRAINT clause.
There are essentially three types of relationships:
One-to-one: - For every record in the primary table, there is one and only one record in the
foreign table.
A. Form C. Report
B. Table D. All
_______2. database object that you can use to create a user interface for a database application.
A. Macros C. Report
B. Form D. All
_______3. Which one is a single field or combination of fields in a table that uniquely identifies each
record in that table
_______4. Which one is a field (or fields) in one table that references the primary key in another table
_______5. Which one of the following is used in access helps you combine data from two different
tables?
Step 5:- Right click on table name customer and select design view
Step 6: - Insert the filed name in to table with datatype and size
Step 7: - Right click on table name and select datasheet view and click on “Yes”
Lap test 1
Task 2:- Insert filed name with appropriate datatype and size or format
This unit is developed to provide you the necessary information regarding the following content
coverage and topics:
Adjusting page layout
Opening and viewing different toolbars
Formatting font as appropriate
This unit will also assist you to attain the learning outcomes stated in the cover page.
Specifically, upon completion of this learning guide, you will be able to:
You can set database options that can be used to modify the design of Access desktop database objects
by clicking File, Options, and then Object Designers. You can set design options for table, form,
report, and query designs from this centralized Access Options location, although most of the settings
are ignored in the table Datasheet and Layout views. You can also customize the selected error checking
settings from this category.
The Ribbon the strip across the top of the program window that contains groups of commands — is a
component of the Microsoft Office Fluent user interface. The Office Fluent user interface provides a
single home for commands in Access.
As you begin to build more advanced applications with Access, you might decide that you want to
customize the Office Fluent Ribbon in order to make an application easier to use. For example, you can
hide some or all of the default tabs so that users cannot use certain commands, and you can create new,
custom tabs that contain only the commands that you want to be available.
The ribbon is the strip of tabs across the top of the program window that contains groups of
commands.
The Backstage view is the collection of commands that you see on the File tab on the ribbon.
The Navigation Pane is the pane on the left side of the Access program window that lets you
work with database objects.
2.2 Adjusting page layout
Layout view
In this lesson, you will familiarize yourself with the Access environment, including
the Ribbon, Backstage view, Navigation pane, Document Tabs bar, and more. You will also learn
how to navigate with a navigation form, if your database includes one.
Access 2016 uses the Ribbon to organize commands, just like in Access 2013 and 2010. If you've used
these versions before, Access 2016 will feel familiar. But if you are new to Access or have more
Page 20 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
experience with older versions, you should first take some time to become familiar with the Access 2016
interface.
Note: - Click the buttons in the interactive below to become familiar with the Access interface.
Ribbon
Access uses a tabbed Ribbon system instead of traditional menus. The Ribbon contains multiple tabs,
each with several groups of commands. For example, the Clipboard group on the Home tab contains
commands such as Cut, Copy, and Paste.
The Quick Access Toolbar, located above the Ribbon, lets you
access common commands no matter which tab you are on. By
default, it shows the Save, Undo, and Redo commands. If
you'd like, you can customize it by adding additional
commands.
1. Click the File tab on the Ribbon. 2. Backstage view will appear
Navigation pane
1. To minimize the Navigation pane, click the double arrow in the upper-right corner.
Self-check 2
___1. Which one of the following in the maximize size of text data?
A. 256 C. 255
B. 1010 D. 1000
___2. Which one is a strip across the top of the program window that contains groups of
commands
A. Ribbon C. Folder
B. Toolbar D. File
___3. ____ is the pane on the left side of the Access program window that lets you work with
database objects.
A. Navigation Pane C. Backstage view
B. Ribbon D. All
___4. Which one is the most intuitive view to use for report modification
A. Layout view
B. Design view
C. Datasheet view
D. All
___5. Which one data type has both custom and Rich Text formatting.
Page 24 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
A. Long Text
B. Short Text
C. Number
D. All
This unit will also assist you to attain the learning outcomes stated in the cover page.
Specifically, upon completion of this learning guide, you will be able to:
Design reports to present data in a logical sequence or manner.
Modify reports to include/exclude additional requirements.
Distribute reports to appropriate person in an approved format.
A report can be created by selecting Create Report on the ribbon. The table or query that is selected
in the object browser when we press Create Report will become the record source of the report. As
with forms, reports can be created in other ways (as blank reports or with the help of a wizard). In this
section we will just look at the simplest type which is a report based on one table. We can select the
table Student in the object browser and press Create Report on the ribbon. The new report will look
like this:
A report is an object in MS Access that is designed for formatting, calculating and printing selected data
in an organized way. It contains information from tables and also information that are there in the report
design. Reports are helpful as they allow you to present all information of your database in an easy-to-
read format.
Formatting reports is one of the strengths of reports is that you can modify their appearance to make
them look how you want. You can add headers and footers, apply new colors, and even add a logo. All
of these things can help you create visually appealing reports.
Let’s take an MS Access databases example of ‘Contact’ DB default report – ‘Phone Book.’
Step 1) Click on ‘Phone Book’ under ‘Report’ section. The system will open the inbuilt ‘Phone Book’
report. It will display Contact Name, Home, Business and Mobile name displayed for each record
present.
Step 3) Edit the name you want to update and Press ‘Ctrl+S’.
Report Wizard
This tool makes it easier to create reports from multiple tables and multiple queries.
In the Create tab Reports group Report Wizard :
When satisfied with the layout of your report, click Next, enter a title for the report, select whether
you want to preview or modify its design, and then click Finish.
3.5. Distributing reports to appropriate person in approved format
3.5.1. Distribute a report
Liberate your Access reports and distribute them far and wide. For example, email them to one or more
users, export them to SharePoint document libraries, and archive them on network folders. When you
distribute an Access report, you create a static report of data at a certain moment in time, such as daily,
weekly, or monthly. By doing so, you have a single point of truth that information workers can use to
make good business decisions, answer questions, find alternatives, determine best plans, evaluate risks,
and improve quality.
Note :- When you create the report, add a publication date. This helps users confirm the correct time
the report was created.
Note:- Although there are a variety of formats you can select, consider using Portable Document
Format (PDF) which has become a defacto standard, preserves the layout and format of the original
Access report, and has built-in ways to customize the pages for viewing and printing.
4. Access opens a new e-mail message in Outlook with the file attached.
5. Type the recipients' e-mail addresses in the To and Cc boxes, a description in the Subject box, and a
message in the message area.
Tip By default, the file that you send by using this method is not saved on your computer. If you want
to save a copy of the file on your computer, right-click the attachment in the Attached box, and then
select Save As.
6. Select Send.
Self-check 3
A. Form C. Query
B. Report D. All
4. ___is one of the strengths of reports is that you can modify their appearance to make them look
how you want.
A. Formatting reports
B. Report view
C. Display view
D. All
5. How many fields are used for sorting access database data report
A. 5 Fields
B. 4 Fields
C. 3 Fileds
D. 1 filed
7. Which one of the following is the advantage of design report?
A. Add header on the report
B. Change the field of the report
C. Easily to read and view
D. All
Grad
Student name Gender Age Level e
Tolosa Mohammed M 20 V C
Biruk Teshome M 19 II NYC
Astir Getnet F 17 IV C
Chaltu Solomon F 18 I C
Kedir Mehamed F 18 I NYC
Note :- Give appropriate data type for the above field
Steps in doing the task
Step 1: - Create database called college and table student
Step 2: - Insert the above given data
Step 5:- Right click on report table name and select Report view then print preview
Grad
Student name Gender Age Level e
Tolosa Mohammed M 20 V C
Biruk Teshome M 19 II NYC
Astir Getnet F 17 IV C
Chaltu Solomon F 18 I C
Kedir Mehamed F 18 I NYC
Note :- Give appropriate data type for the above field
Steps in doing the task
Step 1:- Use the above operation sheet of 4.1 steps 1 and 2
Step 2:- Select the table name and click on create Report wizard
Step 3: - select and move the field and click on Next Next Next sort by “ID”
Note :- This is the last output of the student using report wizard and using specific filed of the table
Quality Criteria:- Create student report using Report wizard
Id_No Employee name Gende Age Level Salary Department Phone number
r
Ep_01 Tale Ayemew M 34 B 8078 Auto 0912312231
Ep_02 Ayenalem Baye F 35 A 10231 ICT 0924535142
Ep_03 Dawit Slemon M 43 A 8012 GMF 0923234342
Task 1: - Create the above database and table and save on desktop
Task 2: - Insert the above data into your data
Task 3: - Using report wizard and use any three filed of the table prepare employee report
This unit to provide you the necessary information regarding the following content coverage
and topics:
Creating a form
Modify database forms
Rearrange object with form
This guide will also assist you to attain the learning outcomes stated in the cover page.
Specifically, upon completion of this learning guide, you will be able to:
Use wizard to create a simple form
Open and record existing database through a simple form modified
Rearrange objects within the form to accommodate information requirements
Forms can be used both for adding and editing data, as well as for browsing and presenting data.
In Access 2016, a form is an object that generally serves three purposes:
1. To allow users to perform data entry. Data can be inserted, updated, or deleted from a
table using a Form object.
2. To allow users to enter custom information, and based on that information perform a
task. For example, you may want to ask a user for parameters before running a report.
3. To allow users a method of navigating through the system. For example, you may
create a form where a user can select a form to load, a report to run, etc.
Plus, to that of the above purposes a form is: -
A form is a database object that you can use to create a user interface for a database
application.
It mainly used to ease the process of data entry or editing.
Data in a form can be selected from one or more tables.
Forms can also be used to control access to data, like which fields or rows of data are
visible to which users.
Forms have a Form View.
Help you to display live data with easy creation of new data.
To create access 2016 database form you must select the create tab in the toolbar at the top of
the screen. Then click on the form design button in the forms group. To view the form property
of Access 2010 database, select the design tab in the toolbar at the top of the screen. Then click
on the property sheet button in the tools group. When the Property Sheet appears,
select Form from the drop down if it is not already selected. You should now see the properties
for the Form object.
It is also primarily being used to enter or display data in a database. You can also use a form as a
switchboard that opens other forms and reports in the database, or as a custom dialog box that
accepts user input and carries out an action based on the input.
A data-entry form
A switchboard form
There are four primary ways to create the form as mentioned below:
1. Form Wizard 3. Multiple Item
2. Default Form 4. Split Form
Let’s have a look at each option to create the form, one by one:
1. Create using Form Wizard
The wizard lets you make decisions about certain aspects of a form's design and produces a form
based on your instructions. The form wizard gives you more control over your results than one-
click forms do. The wizard lets you make decisions about certain aspects of a form's design and
produces a form based on your instructions. To create a form based on a single table using the
Form Wizard, follow these nine steps.
Note: -This feature works the same in all modern versions of Microsoft Access: 2010, 2013,
and 2016.
This option allows the user to create the form with the wizard and select the column from the
available list of column form in legacy Select window format.
Step 1) Click on ‘Form Wizard.’
Step 3) Select the columns which you want to be there in final form.
Result: ID is selected
Step 5) Layout selection box will appear which allows the user to select the different type of
form layout. Click ‘NEXT’
Step 6) Enter the name of the form as “Contact_Form” and click ‘Finish.’
By default, populate all the column from the selected table in ‘form view,’
The user can delete non-required column manually
Step 1) Select the table for which we want to create the form and click on ‘Form.’
Step 3) Right-click on any cell which we don’t want to be part of final forms and click on
‘Delete.’
Step 4) Press ‘Ctrl+S’ and enter new Form Name as ‘Contact_Form2’. Click ‘OK’.
Result: New form with the name as ‘Contact_Form2’ exists under the “Forms” section.
Step 2) Press ‘Ctrl+S’. Enter the new form name and click ‘OK.’
Page 47 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
Result: New Form with the name as ‘Contact_Form_Multiple_Item’ exists under the “Forms”
section.
Step 2) Press ‘Ctrl+S’ and enter the new form name. Click ‘OK.’
Layout View: - this view is similar to Design View but is more visually-
oriented in that each control displays real data. As a result, this is a very useful
view for setting the size of controls, or performing many other tasks that affect the visual
appearance and usability of the form.
Design View: - this view gives you a more detailed view of the structure of
the form. You can see the header, detail, and footer sections for the form.
You cannot see the underlying data while you are making design changes.
To open an existing form:
1. Open your database and locate the Navigation pane.
2. In the Navigation pane, locate the form you want to open.
Step 3) Manually fill the data from Form. Note that in split form all data will be automatically
reflected in below data sheet as well.
The Rearrange objects commands make permanent changes in your form. Save a copy of your
form before making such changes. Rearranging the page order in the design form work screens.
Do one of the following: On the Arrange tab, in the Table group, click the layout type that you
want for the new layout (Tabular or Stacked).default, when you create a new form by using one
of the form tools on the Create tab, or when you add fields to a form while it is open in Layout
view, Access puts text boxes and other controls in guides called layouts. A layout, indicated by
an orange grid around the cons you align controls horizontally and vertically to give the form a
uniform appearance. The following illustration shows a "stacked" layout on a form that is open
in Layout view:
To move a field:
1. Locate the field you want to move, then hover your mouse over the bottom border of the field
header. The cursor will become a four-sided arrow. Hovering the mouse over the field.
2. Click and drag the field to its new location. Moving a field.
3. Release the mouse. The field will appear in the new location.
Although layouts can help you quickly create and modify a form, in some cases, you might
prefer having the ability to move and size controls
independently. This article describes how to remove controls
from layouts, after which you can move and resize them
without affecting other controls.
3. Drag the layout by using the layout selector at the upper-left corner of
the layout.
If you want to create a way for users of your form to quickly perform specific actions and tasks,
consider adding command buttons. When you create a command button, you specify an action
for it to carry out when clicked. By including commands for common tasks right in your form,
you're making the form easier to use.
Access offers many different types of command buttons, but they can be divided into a few main
categories:
Record Navigation command buttons, which allow users to move among the
records in your database.
Record Operation command buttons, which let users do things like save and print
a record.
Form Operation command buttons, which allow users to quickly open or close a
form, print the current form, and perform other actions
Page 56 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
Report Operation command buttons, which offer users a quick way to do things
3. Choose the desired location for the command button, then click the mouse.
4. The Command Button Wizard will appear. In the Categories pane, select the
category of button you want to add. We want to find a way to move more quickly
to specific records, so we'll choose the Record Navigation category.
5. The list in the Actions pane will update
to reflect your chosen category. Select
the action you want the button to
perform, then click Next. In our
example, we'll choose Find Record.
A. Form C. View
B. Design D. All
___5. Which one of the following statement is true when your data record is modifying?
A. The existing data is replaced by the new one
B. The existing data is store in other location
C. The old and new data is store in the same table
D. All
Page 59 of 98 Ministry of Labor and Operating Database Version -1
Skills
Author/Copyright Application September , 2022
Part II: - Give shore answer for
1. What is the main purpose of using form in access database?
2. List and explain the way of creating form?
3. Write down the steps the open the existing access database form?
Step 5: - Click here or select all textbox and resize the text box and level
Step 5:- Click on the normal table name and view the modified data
Quality Criteria: Insert the given data and modify the existing data using form
Task 1: - Create access database called college and the table name employee
Task 4: - Modify the last two employee salary into 7000 and 6000 respectively.
This unit will also assist you to attain the learning outcomes stated in the cover page.
Specifically, upon completion of this learning guide, you will be able to:
A query is what you will use to retrieve information from your database. It consists of questions
of which Access will give you the answers in the form of data from tables within your database.
Queries are what make it easy to find data, then create new tables based on the queries.
Queries are a fundamental means of accessing and displaying data from tables. Queries used to
view, update, and analyze data in different ways. Queries can access a single table or multiple
tables. For example, you want to view a list of employee id and name, but you do not want to see
phone number and other data, you can create a query that displays the employee’s id and name
only.
Queries answer a question by selecting and sorting and filtering data based on search criteria.
Queries show a selection of data based on criteria (limitations) you provide. Queries can pull
from one or more related Tables and other Queries. Types of Query can be SELECT, INSERT,
UPDATE, DELETE.
Queries show a selection of data based on criteria (limitations) you provide. Queries can pull
from one or more related Tables and/or other Queries. The Datasheet View of a Query looks like
a Table. All data added or modified in a Query, will be saved in the Table. The Design View is
A query is a derived item in the database meant to answer specific questions that relate to the
information in the database. Queries are handy during data processing.
To find and retrieve just the data that meets conditions that you specify, including data from
multiple tables, create a query. A query can also update or delete multiple records at the same
time, and perform predefined or custom calculations on your data.
A query requests data from the database. At its simplest, a query merely fetches all data from
a single table. But as you create more complex (and more typical) queries, you can assemble
exactly the data you want (i.e. unique sets of data that you require at any given time).
Queries can also be used to execute mathematical and logical functions to obtain certain
information in the database.
Queries are derived from and linked to tables or other queries. (Due to these linkages, they
tend to largely inflate the size of the database and should thus only be used to execute the
intended functions, and stored only if updated information is to be retrieved).
There are various types of queries for different uses but for this session we will just focus on the
Select queries:
Select queries :- A select query is the most common type of query. It retrieves
data from one or more tables and displays the results in a datasheet where you can
update the records (with some restrictions). You can also use a select query to
group records and calculate sums, counts, averages, and other types of totals.
Example: Select all student’s information
Step 1: - Select or click on table name
Step 2: click on queries wizard then
select simple queries wizard and ok
Step 3: - Move all filed from available fields into selected fields by clicking “>>” and Finish
Parameter queries are also handy when used as the basis for forms, reports, and data access
pages. For example, you can create a monthly earnings report based on a parameter query. When
you print the report, Access displays a dialog box asking for the month that you want the report
to cover. You enter a month and Access prints the appropriate report.
Crosstab queries :- You use crosstab queries to calculate and restructure data for
easier analysis of your data. Crosstab queries calculate a sum, average, count, or
other type of total for data that is grouped by two types of information one down
the left side of the datasheet and another across the top.
Action queries
In order to control which records are displayed, you must define criteria in a query. The most
common type of query is the Select Records query which will be discussed below.
To Define Criteria for Your Query:
1. Position your cursor in the criteria row in the field for which you wish to define the
criteria
2. Type the criteria
You can also use the Between operator to filter for a range of
values, including the end points. For example, Between
#2/2/2006# and #2/4/2006# is the same as >=#2/2/2006# and
<=#2/4/2006# .
Contain values that <#2/2/2006# or Returns records where the transactions took place before Feb 2,
fall outside a range >#2/4/2006# 2006 or after Feb 4, 2006.
Contain one of two #2/2/2006# or #2/3/2006# Returns records of transactions that took place on either Feb 2,
values, such as 2006 or Feb 3, 2006.
2/2/2006 or 2/3/2006
Contain one of many In (#2/1/2006#, Returns records where the transactions took place on Feb 1, 2006,
values #3/1/2006#, #4/1/2006#) March 1, 2006, or April 1, 2006.
Contain a date that DatePart("m", Returns records where the transactions took place in December of
falls in a specific [SalesDate]) = 12 any year.
month (irrespective of
year), such as
December
Contain a date that DatePart("q", Returns records where the transactions took place in the first
falls in a specific [SalesDate]) = 1 quarter of any year.
quarter (irrespective of
year), such as the first
quarter
Contain today's date Date() Returns records of transactions that took place on the current day.
If today's date is 2/2/2006, you see records where the OrderDate
field is set to Feb 2, 2006.
Contain yesterday's Date()-1 Returns records of transactions that took place the day before the
date current day. If today's date is 2/2/2006, you see records for Feb 1,
2006.
Contain tomorrow's Date() + 1 Returns records of transactions that took place the day after the
date current day. If today's date is 2/2/2006, you see records for Feb 3,
2006.
Multivalued fields
Data in a multivalued field are stored as rows in a hidden table that Access creates and populates
to represent the field. In query Design view, this is represented in the Field List by using an
expandable field. To use criteria for a multivalued field, you supply criteria for a single row of
the hidden table. To do this:
1. Create a query containing the multivalued field, and open it in Design view.
2. Expand the multivalued field by clicking the plus symbol (+) next to it — if the field is already
expanded, this is a minus symbol (-). Just below the name of the field, you will see a field
representing a single value of the multivalued field. This field will have the same name as the
multivalued field, with the string. Value appended.
3. Drag the multivalued field and its single value field to separate columns in the design grid. If you
want to see only the complete multivalve field in your results, clear the Show check box for the
single value field.
4. Type your criteria in the Criteria row for the single value field, using criteria that is appropriate
for whatever type of data the values represent.
5. Each value in the multivalued field will be individually evaluated using the criteria you supply.
For example, you may have a multivalued field that stores a list of numbers. If you supply the
criteria >5 AND <3, any record where there is at least one value greater than 5 and one value less
than 3 will match.
5.5. Selecting data and display appropriately
Select Create > Query Wizard. Select Simple Query, and then OK. Select the table that
contains the field, add the Available Fields you want to Selected Fields, and select Next. Choose
whether you want to open the query in Datasheet view or modify the query in Design view, and
then select Finish. Access offers several options for making your queries work better for you. In
addition to modifying your query criteria and joins after you build your queries, you can choose
to sort and hide fields in your query results.
Input masks
An input mask is used to provide some control over what values can be entered. They are
primarily used in Text and Date/Time fields, but can also be used in Number or Currency fields.
Input Mask are used when data is entered in a fixed pattern of numbers, letters, spaces etc., such
as a National Insurance number but is unsuitable where the pattern varies (e.g. postcode or
telephone number). When you click in the input mask area, a build button appears on the right.
Clicking this button will enable the Input Mask wizard, which will help you select an appropriate
input mask for your field.
A. Report C. Query
B. Form D. Al
3. Which one is retrieves data from one or more tables and displays the results in a
datasheet
A. Is Null C. Like
B. Is Not Null D. All
5. Which one is Returns records where the value is not missing in the give field.
A. Is Null C. Like
B. Is Not Null D. All
6. Which types of filed is used based on the values from an existing data source depend
on the data type of the foreign key
A. Attachment
B. Lookup fields
C. Multivalued fields
D. All
Step 3:- Move all filed from available fields into selected fields by clicking “>>” and Next
Step 2: - select table name and click on “Ok” then click “close”
Step 3: - Double click on the field of the criterial to select data from the table
Step 4: - write down the criteria or “C” on grade and “F” on gender
Step 5: click on
Right click on query name and save as
Give name on file and OK