You are on page 1of 28

SHASHEMENE POLY TECHNIQUE COLLAGE

INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

SHASHEMENE POLY TECHNIQUE COLLAGE


INFORMATION TECHNOLOGY SERVICE
MANAGEMENT
OPERATE DATA BASE APPLICATION

MODULE TITLE: Operate Database Application


LEARNIG OUTCOME:-
 Create database objects
 Customize basic settings
 Create reports
 Create forms
 Retrieve information

Introduction
This unit defines the competency required to
operate database applications and perform basic
operations.

_____________________________________________________________________ 1
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
INFORMATION LO1
Create database objects
SHEET
MODULE Operate Database Application

1. Few database terms:


Database consists of the following words those are used often in Access so we will
become familiar with them before using the program.
 Database: A database is a tool for collecting and organizing information.
A database is a structured collection of records.

Databases can store information about people, products, orders, or anything else. Many
databases start as a list in a word-processing program or spreadsheet. As the list grows
bigger, redundancies and inconsistencies begin to appear in the data. The data becomes
hard to understand in list form, and there are limited ways of searching or pulling subsets
of data out for review. Once these problems start to appear, it's a good idea to transfer the
data to a database created by a database management system (DBMS), such as Office

access.

Database Management System (DBMS)


i. add, remove, update records
ii. retrieve data that match certain criteria
iii. cross-reference data in different tables
iv. perform complex aggregate calculation

Unlike that of word and excel, access can prevent data redundancy by giving primary key
for fields that cannot need similar record in the field. We call database as a collection of
related information. One database can contain more than one table. For example
TVET.accdb may contain trainer table, trainee table and competency table.

.accdb in Access is file extension created when we create our database.

An object: is a competition in the database such as a table, query, form, or macro.

A table: is a group of related data organized in fields (columns) and records (rows) on a
datasheet. By using a common field in two tables, the data can be combined. Many tables
can be stored in a single database.

_____________________________________________________________________ 2
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
A field: is a column on a datasheet and defines a data type for a set of values in a table.
For a mailing list table might include fields for first name, last name, address, city, state,
zip code, and telephone number.

A record: is a row on a datasheet and is a set of values defined by fields. In a mailing list
table, each record would contain the data for one person as specified by the intersecting
fields.

Design View: provides the tools for creating fields in a table.

Datasheet View: allows you to update, edit, and delete information from a table.

1.1 Blank Access database

1. Unlike Word documents, Excel worksheets, and Power Point presentations, you must
save an Access database before you start working on it. After selecting "Blank Access
database", you will first be prompted to specify a location and name for the database.
2. Find the folder where the database should reside in the Save in drop-down menu.

3. Type the name of the database in the File name line and click the Create button.
After you click create button the following box is appear.

_____________________________________________________________________ 3
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

2. Screen Layouts
2. 1 navigation pane (Database Window in older access)

In Office Access 2007, you use the pane to accomplish most of the tasks that you
previously did with the Database window. For example, you use the pane to open

database components (called objects in Access) for use or for design changes. One of the
easiest ways to find out what you can do with an object is to right-click it and explores
the resulting pop-up menu.

2.2 Design View


Design View customizes the fields in the database so that data can be entered. To create
database we must insert different fields of your table. Each field has their own data type
and we
need to
select

_____________________________________________________________________ 4
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
appropriate data type for entire field. We can also apply different format for fields and
validate records to be inserted into entire field.

2.3 Datasheet View: it consists of table with fields that is used to


insert records of database.

3. Creating Tables

Introduction to Tables
Table is grids that store information in a database similar to the way an Excel worksheet
stores information in a workbook. A database table is similar in appearance to a
spreadsheet, in that data is stored in rows and columns. As a result, it is usually quite easy
to

import a spreadsheet into a database table. Each row in a table is referred to as a record.
Records are where the individual pieces of information are stored. Each record consists of
one or more fields. Fields correspond to the columns in the table. Fields must be
designated as a certain data type, whether it's text, date or time, number, or some other
type.The main difference between storing your data in a spreadsheet and storing it in a

_____________________________________________________________________ 5
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
database is in how the data is organized. To get the most flexibility out of a database; the
data needs to be organized into tables so that redundancies don't occur. To create tables
we use Create table in Design view which allows us to create the fields of the table. This
is the most common way of creating a table and is explained in detail below.

Create a Table in Design View


Design View will allow you to define the fields in the table before adding any data to the
datasheet. The window is divided into two parts: a top pane for entering the field name,
data type, and an option description of the field, and a bottom pane for specifying field
properties.

Field Name - This is the name of the field and should represent the contents of the field
such as "Name", "Address", "Final Grade", etc. The name can not exceed 64 characters in
length and may include spaces.
Data Type is the type of value that will be entered into the fields.

 Text - The default type, text type allows any combination of letters and numbers
up to a maximum of 255 characters per field record.
 Memo - A text type that stores up to 64,000 characters.
 Number - Any number can be stored.
 Date/Time - A date, time, or combination of both.
 Currency - Monetary values that can be set up to automatically include a dollar
sign ($) and correct decimal and comma positions.
 AutoNumber - When a new record is created, Access will automatically assign a
unique integer to the record in this field. From the General options, select
_____________________________________________________________________ 6
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Increment if the numbers should be assigned in order or random if any random
number should be chosen. Since every record in a datasheet must include at least
one field that distinguishes it from all others, this is a useful data type to use if the
existing data will not produce such values.
 Yes/No - Use this option for True/False, Yes/No, On/Off, or other values that
must be only one of two.
 OLE Object - An OLE (Object Linking and Embedding) object is a sound,
picture, or other object such as a Word document or Excel spreadsheet that is
created in another program. Use this data type to embed an OLE object or link to
the object in the database.
Description (optional) - Enter a brief description of what the contents of the field are.
Field Properties - Select any pertinent properties for the field from the bottom pane.
Field Properties: Properties for each field are set from the bottom pane of the
Design View window.

 Field Size is used to set the number of characters needed in a text or number field.
The default field size for the text type is 50 characters. If the records in the field
will only have two or three characters, you can change the size of the field to save
disk space or prevent entry errors by limiting the number of characters allowed.
Likewise, if the field will require more than 50 characters, enter a number up to
255. The field size is set in exact characters for Text type, but options are give for
numbers:

C Byte - Positive integers between 1 and 255


C Integer - Positive and negative integers between -32,768 and 32,768
C Long Integer (default) - Larger positive and negative integers between -2
billion and 2 billion.
C Single - Single-precision floating-point number
C Double - Double-precision floating-point number
C Decimal - Allows for Precision and Scale property control

 Format conforms the data in the field to the same format when it is entered into
the datasheet. For text and memo fields, this property has two parts that are
separated by a semicolon. The first part of the property is used to apply to the field
and the second applies to empty fields.

C Text and memo format.

Text Format
Format Datasheet Entry Display Explanation
@@@-@@@@ @ indicates a
1234567 123-4567 required
character or space
@@@-@@@& & indicates an
123456 123-456 optional
character or space
_____________________________________________________________________ 7
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
< < converts
HELLO hello characters to
lowercase
> converts
> hello HELLO characters to
uppercase
@\! \ adds characters to
Hello Hello!
the end
@;"No Data Entered" Hello Hello  
@;"No Data Entered" (blank) No Data Entered  

C Number format. Select one of the preset options from the drop down menu or
construct a custom format using symbols explained below:

Number Format
Format Datasheet Entry Display Explanation
###,##0.00 123456.78 123,456.78 0 is a placeholder that displays a
digit or 0 if there is none.

$###,##0.00 0 $0.00 # is a placeholder that displays a


digit or nothing if there is none.

% multiplies the number by 100 and


###.00% .123 12.3%
added a percent sign

C Currency format. This formatting consists of four parts separated by


semicolons (:) format for positive numbers; format for negative numbers;
format for zero values; format for Null values.

Currency Format
Format Explanation
$##0.00;($##0.00)[Red];$0.00;"none" Positive values will be normal currency
format, negative numbers will be red in
parentheses, zero is entered for zero
values, and "none" will be written for
Null values.

C Date format. In the table below, the value "1/1/01" is entered into the
datasheet, and the following values are displayed as a result of the different
assigned formats.

Date Format

_____________________________________________________________________ 8
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Format Display Explanation
dddd","mmmm d","yyyy Monday, January 1, 2001 dddd, mmmm, and yyyy
print the full day name,
month name, and year
ddd","mmm ". " d", '"yy Mon, Jan. 1, '01 ddd, mmm, and yy print
the first three day letters,
first three month letters,
and last two year digits
"Today is " dddd Today is Monday  
h:n:s: AM/PM 12:00:00 AM "n" is used for minutes to
avoid confusion with
months

C Yes/No fields are displayed as check boxes by default on the datasheet. To change


the formatting of these fields, first click the Lookup tab and change the Display
Control to a text box. Go back to the General tab choices to make formatting
changes. The formatting is designated in three sections separated by semicolons.
The first section does not contain anything but the semicolon must be included.
The second section specifies formatting for Yes values and the third for No
values.

Yes/No Format
Format Explanation
;"Yes"[green];"No"[red] Prints "Yes" in green or "No" in red

C Default Value - There may be cases where the value of a field will usually be the
same for all records. In this case, a changeable default value can be set to prevent
typing the same thing numerous times. Set the Default Value property.

Database keys:

i. Primary Key
Every record in a table must have a primary key that differentiates it from every other
record in the table. In some cases, it is only necessary to designate an existing field as
the primary key if you are certain that every record in the table will have a different
value for that particular field. A social security number or identification number or
phone number are an example of a record whose values will only appear once in a
database table.
Under primary key field:

C Value unique for each record in a table


_____________________________________________________________________ 9
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
C This value cannot be used twice

C AutoNumber guarantees uniqueness but does not carry any useful information
ii. Foreign keys
i. Used to create relationships between tables
ii. No uniqueness constraint for foreign keys
Relation between primary and foreign keys
- Same format
- Same values
Designate the primary key field by right-clicking on the record and selection Primary
Key from the shortcut menu. The primary key field will be noted with a key image to the
left. To remove primary key from field, r/click on it and select primary key.

Indexes
Creating indexes allows Access to query and sort records faster. To set an indexed field,
select a field that is commonly searched and change the Indexed property to Yes
(Duplicates OK) if multiple entries of the same data value are allowed or Yes (No
Duplicates) to prevent duplicates.

Field Validation Rules


Validation Rules specify requirements (change word) for the data entered in the
worksheet. A customized message can be displayed to the user when data that violates
the rule setting is entered. Click the expression builder ("...") button at the end of the
Validation Rule box to write the validation rule. Examples of field validation rules
include <> 0 to not allow zero values in the record, and ???  to only all data strings three
characters in length.

Input Masks
An input mask controls the value of a record and sets it in a specific format. We can also
create a password for entire field such as idno that means converting it in to unreadable
format as(****).to do this select the field---->click on inputmask----->select password.
For example, a telephone number field can formatted with an input mask to accept ten
digits that are automatically formatted as "(999) 888-7777". The blank field would look
like (___) ___-____. An input mask to a field by following these steps:

1. In design view, place the cursor in the field that the input mask will be applied to.
2. Click in the white space following Input Mask under the General tab.
3. Click the "..." button to use the wizard or enter the mask, (@@@) @@@-
@@@@, into the field provided. The following symbols can be used to create an
input mask from scratch:

Input Mask Symbols


Symbol Explanation
A Letter or digit
0 A digit 0 through 9 without a + or - sign and with blanks displayed as
_____________________________________________________________________ 10
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
zeros
9 Same as 0 with blanks displayed as spaces
# Same as 9 with +/- signs
? Letter
L Letter A through Z
C or & Character or space
< Convert letters to lower case
> Convert letters to upper case

_____________________________________________________________________ 11
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Datasheet Records

Adding Records
Add new records to the table in datasheet view by typing in the record beside the asterisk
(*) that marks the new record. You can also click the new record button at the bottom of
the datasheet to skip to the last empty record.

Editing Records
To edit records, simply place the cursor in the record that is to be edited and make the
necessary changes. Use the arrow keys to move through the record grid. The previous,
next, first, and last record buttons at the bottom of the datasheet are helpful in
maneuvering through the datasheet.

Deleting Records
Delete a record on a datasheet by placing the cursor in any field of the record row and
R/click on it ,select Delete Record.

Adding and Deleting Columns


Although it is best to add new fields (displayed as columns in the datasheet) in design
view because more options are available, they can also be quickly added in datasheet
view. Highlight the column that the new column should appear to the left of by
R/clicking on it and select Insert|Column. We can delete column by applying the same
step and select delete instead of insert.

Resizing Rows and Columns


The height of rows on a datasheet can be changed by dragging the gray sizing line
between row labels up and down with the mouse. By changing the height on one row, the
height of all rows in the datasheet will be changed to the new value.

_____________________________________________________________________ 12
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Column width can be changed in a similar way by dragging the sizing line between
columns. Double click on the line to have the column automatically fit to the longest
value of the column. Unlike rows, columns on a datasheet can be different widths. More
exact values can be assigned by selecting Format|Row Height or Format|Column
Width from the menu bar.

Hiding Columns
Columns can also be hidden from view on the datasheet although they will not be deleted
from the database. To hide a column, place the cursor in any record in the column or
highlight multiple adjacent columns, r/clicking and select hide column.

Finding and replace Data in a Table


Data in a datasheet can be quickly located by using the Find command.
1. Open the table -->click on home tab--->find(ctrl+F)
Find and replace dialog box will be appeared as follow

2. insert the record you want to replace with new record on “find what”
3. Click on find next ----->click on replace tab----->then dialog box is expanded.
4. insert new record on replace with and select replace if the record is only one or select
replace all to replace all records similar with record written on find what.

Check Spelling and AutoCorrect


The spell checker can be used to flag spelling errors in text and menu fields in a
datasheet. To check spelling we need to open the table then go to home tab ,click on
spelling and select the correct spelling for your record.
Print a Datasheet
Datasheets can be printed by clicking the office button---> select Print and set printing
options such as number of copy, page ranges as needed.

INFORMATION LO2
Create reports
SHEET
MODULE Operate Database Application

Introduction to Reports
Reports will organize and group the information in a table or query and provide a way to
print the data in a database. Reports are what you use to summarize and present data in
the tables. A report usually answers a specific question. A report can be run at any time,
_____________________________________________________________________ 13
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
and will always reflect the current data in the database. Reports are generally formatted to
be printed out. A report consists of information that is pulled from tables or queries, as
well as information that is stored with the report design, such as labels, headings, and
graphics. The tables or queries that provide the underlying data are also known as the
report's record source. If the fields that you want to include all exist in a single table, use
that table as the record source. If the fields are contained in more than one table, you need
to use one or more queries as the record source.

Create a report by using the Report tool

The Report tool provides the fastest way for you to create a report, because it generates a
report immediately without prompting you for information. The report displays all the
fields from the underlying table or query. The Report tool may not create the final,
polished product that you ultimately want, but it is quite useful as a means to quickly
look at the underlying data. You can then save the report and modify it in Layout view or
Design view so that it better serves your purposes.

1. In the Navigation Pane, click the table or query on which you want to base the
report.

2. On the Create tab, in the Reports group, click Report.

3. Access builds the report and displays it in Layout view.

4. For more about viewing and printing your report, see the section View, print, or
send your report as an e-mail message.After viewing the report, you can save it
and then close both the report and the underlying table or query that you used as a
record source. The next time that you open the report, Access will display the
most recent data from your record source.

Create a report by using the Report Wizard

You can use the Report Wizard to be more selective about what fields appear on your
report. You can also specify how the data is grouped and sorted, and you can use fields
from more than one table or query, provided you have specified the relationships between
the tables and queries beforehand. Find links to more information about creating
relationships in the See Also section.

_____________________________________________________________________ 14
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
1. On the Create tab, in the Reports group, click Report Wizard.

2. Follow the directions on the Report Wizard pages. On the last page, click Finish.
When you preview the report, you see the report as it will appear in print.

Create a report by using the Blank Report tool

If you aren't interested in using the Report tool or the Report Wizard, you can use the
Blank Report tool to build a report from scratch. This can be a very quick way to build a
report, especially if you plan to put only a few fields on your report. The following
procedure explains how to use the Blank Report tool:

1. On the Create tab, in the Reports group, click Blank Report.

2. A blank report is displayed in Layout view, and the Field List (field list: A
window that lists all the fields in the underlying record source or database
object, except in data access page Design view. In data access page Design
view, it lists all the record sources and their fields in the underlying database.)
pane is displayed on the right side of the Access window.

3. In the Field List pane, click the plus sign next to the table or tables containing
the fields that you want to see on the report.

4. Drag each field onto the report one at a time, or hold down CTRL and select
several fields, and then drag them onto the report at the same time.

_____________________________________________________________________ 15
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
5. Use the tools in the Controls group on the Formatting tab to add a logo, title,
page numbers, or the date and time to the report.

Create report in Design view

You can also create reports in Design view. You can add new controls and fields to the
report by adding them to the design grid. The property sheet gives you access to a large
number of properties that you can set to customize your report. To switch to Design view,
right-click the report name in the Navigation Pane and then click Design View .
Access shows the report in Design view. You can use the property sheet to modify the
properties for the report itself and the controls and sections it contains. To display the
property sheet, press F4. You can use the Field List pane to add fields from the
underlying table or query to your report design. To display the Field List pane, do one of
the following:

1. On the Formatting tab, in the Controls group, click Add Existing Fields.

2. Press ALT+F8.

You can then add fields by dragging them from the Field List pane to the report.

Add fields from the Field List pane:

1. To add a single field, drag the field from the Field List pane to the section
where you want it displayed on the report.

2. To add several fields at once, hold down CTRL and click the fields that you
want. Then, drag the selected fields onto the report. When you drop the fields
onto a report section, Access creates a bound text box control for each field
and automatically places a label control beside each field. Finally we can print
our report if needed.

_____________________________________________________________________ 16
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
INFORMATION LO3
Create forms
SHEET
MODULE Operate Database Application

A form is a database object that you can use to enter, edit, or display data from a table or
a query. Forms are used as an alternative way to enter data into a database table.
You can use forms to control access to data, such as which fields or rows of data are
displayed. We might need to see only several fields in a table with many fields.
Performing such task with a form that contains just some fields makes it easier for us to
use the database. You can also add buttons and other functionality to a form to automate
frequently performed actions. A visually attractive form makes working with the database
more pleasant and more efficient, and it can also help prevent incorrect data from being
entered.

Create a form by using the Form Wizard

To be more selective about what fields appear on your form, you can use the Form
Wizard. You can also define how the data is grouped and sorted, and you can use fields
from more than one table or query, provided that you specified the relationships between
the tables and queries beforehand

1. On the Create tab, in the Forms group, click More Forms, and then click Form
Wizard.

_____________________________________________________________________ 17
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

2. After you insert wanted fields click on next and choose one of the following as
needed.

Columnar - A single record is displayed at one time with labels and form fields listed
side-by-side in columns

Justified - A single record is displayed with labels and form fields are listed across
the screen

Tabular - Multiple records are listed on the page at a time with fields in columns and
records in rows

Datasheet - Multiple records are displayed in Datasheet View

3. Follow the directions on the pages of the Form Wizard.

4. Note    If you want to include fields from multiple tables and queries on your
form, do not click Next or Finish after you select the fields from the first table
or query on the first page of the Form Wizard. Instead, repeat the steps to
select a table or query, and click any additional fields that you want to include
on the form. Then click Next or Finish to continue give a name for your form.

5. On the last page of the wizard, click Finish.

Create a form by using the Blank Form tool

If the wizard don't fit your needs, you can use the Blank Form tool to build a form. This
can be a very quick way to build a form, especially if you plan to put only a few fields on
your form.

1. On the Create tab, in the Forms group, click Blank Form.

Access opens a blank form in Layout view, and displays the Field List pane.

_____________________________________________________________________ 18
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

2. In the Field List pane, click the plus sign (+) next to the table or tables that
contain the fields that you want to see on the form.

3. To add a field to the form, double-click it or drag it onto the form. To add several
fields at once, hold down CTRL and click several fields, and then drag them onto
the form at the same time.

4. Use the tools in the Controls group on the Formatting tab to add a logo, title,
page numbers, or the date and time to the form.

5. If you want to add a wider variety of controls to the form, switch to Design view
by right-clicking the form and then clicking Design View . You can then use
the tools in the Controls group on the Design tab.

_____________________________________________________________________ 19
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Form controls: symbols used to control records found within the table by staying on
form. Some of them are as follows:

Text box

The text box is the standard control used for viewing and editing data on forms and
reports. Many different types of data can be displayed in text boxes, and you can also use
them to perform calculations. This article explains how to create and use a text box and
also explains some important text box properties.

Button

We use a command button on a form to start an action or a set of actions. For example,
we can create a command button that opens another form, add record, delete, go to next
records. In general button is used to edit records found within the table. Form controls are
not only text box and button there are different controls used for different purposes.

Check Boxes and Option Button

We use check boxes and option buttons to display yes/no, true/false, or on/off values.
Only one value from a group of option buttons can be selected while any or all values
from a check box group can be chosen. Typically, these controls should be used
when five or fewer options are available. Combo boxes or lists should be used for
long lists of options.

Creating sub form

A sub form is a form that is inserted in another form. The primary form is called the main
form, and the form within the form is called the subform. A form/subform combination is
sometimes referred to as a hierarchical form or a parent/child form.
_____________________________________________________________________ 20
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
Sub forms are especially effective when you want to show data from tables or queries
that have a one-to-many relationship. For example, you can create a form that contains a
sub form to show data from a trainer table and a trainee table. The data in the trainer table
is the "one" side of the relationship. The data in the trainee table is the "many" side of the
relationship — each trainer can train more than one trainee. We can also split a single
form in to multiple part. To create split form first we select the table from which we are
going to create form then go to create and select split

INFORMATION LO4 Retrieve information


SHEET
MODULE Operate Database Application

Retrieving information: One of retrieving information mechanism is creating query.


Queries are the real workhorses in a database, and can perform many different functions.
Their most common function is to retrieve specific data from the tables. The data you
want to see is usually spread across several tables, and queries allow you to view it in a
single datasheet. Also, since you usually don't want to see all the records at once, queries
let you add criteria to "filter" the data down to just the records you want. Queries often
serve as the record source for forms and reports.we can create query not only from a
single table but also from multiple tables.

To create query

1. Select the table from which you are going to create query

2. Click on create----->select query in design

_____________________________________________________________________ 21
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

We write one of the following query wildcards on criteria to indicate the record we want
to select.
Some of wildcards used in query creation are as follows:
Query Wildcards and Expression Operators
Wildcard /
Explanation
Operator
? Street The question mark is a wildcard that takes the place of a single
letter.
43th * The asterisk is the wildcard that represents a number of
characters.
<100 Value less than 100
>=1 Value greater than or equal to 1
<>"FL" Not equal to (all states besides Florida)
Between 1 and 10 Numbers between 1 and 10
Is Null Finds records with no value
Is Not Null or all records that have a value
Like "a*" All words beginning with "a"
>0 And <=10 All numbers greater than 0 and less than 10
"Bob" Or "Jane" Values are Bob or Jane

3. Finally give filename of your query

Query types

a) Select query: is a type of database object that shows information in Datasheet


view. A query can get its data from one or more tables, from existing queries, or
from a combination of the two. The tables or queries from which a query gets its
data are referred to as its record source. Whether you create simple select queries
by using a wizard or in Design view, the steps are essentially the same. The above
listed steps are ways of creating select query.

_____________________________________________________________________ 22
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
b) Append query: An append query adds a set of records (rows) from one or more
source tables (or queries) to one or more destination tables. Typically, the source
and destination tables reside in the same database.

The process of creating an append query follows these basic steps:

1. Create a select query.

2. Convert the select query to an append query.

3. Choose the destination fields for each column in the append query.

4. Run the query to append the records.

c) Make table queries: it retrieves data from one or more tables, and then loads the
result set into a new table. That new table can reside in the database that you have
open, or you can create it in another database. Typically, you create make table
queries when you need to copy or archive data.

The process of creating a make table query follows these broad steps:

 Enable the database, if it is not signed or if it does not reside in a trusted


location. You cannot run action queries (append, update, and make table
queries) otherwise.

 In query Design view, create a select query and then modify that query until it
returns the records you want.

4. Update query: used to add, change, or delete the data in one or more
existing records. It is a powerful form of the Find and Replace dialog box. You
enter a select criterion (the rough equivalent of a search string) and an update
criterion (the rough equivalent of a replacement string). Unlike the Find and
Replace dialog box, update queries can accept multiple criteria, allow you to
update a large number of records in one pass, and allow you to change records
in more than one table at one time

_____________________________________________________________________ 23
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
5. Delete query: used to delete records from entire table. First we need to
create select query and change in to delete by clicking on delete query. Before
planning to create delete query you have to take a backup of your database.

Back up your database

Process used to backup database:


1. Click the Microsoft Office Button , point to Manage, and then, under
Manage this database, click Back Up Database.

2. In the Save As dialog box, specify a name and location for the backup copy, and
then click Save. Access closes the original file, creates a backup, and then
reopens the original file. To revert to a backup, close and rename the original
file so that the backup copy can use the name of the original version. Assign the
name of the original version to the backup copy, and open the renamed backup
copy in Access

Table Relationship

To prevent the duplication of information in a database by repeating fields in more than


one table, table relationships can be established to link fields of tables together. Follow
the steps below to set up a relational database:

Create a table relationship by using the Relationships document tab

1. Click the Microsoft Office Button , and then click Open.

2. In the Open dialog box, select and open the database.

3. On the Database Tools tab, in the Show/Hide group, click Relationships.

_____________________________________________________________________ 24
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
4. If you have not yet defined any relationships, the Show Table dialog box
automatically appears. If it does not appear, on the Design tab, in the Relationships
group, click Show Table.

The Show Table dialog box displays all of the tables and queries in the database. To
see only tables, click Tables. To see only queries, click Queries. To see both, click
Both.

5. Select one or more tables or queries and then click Add. After you have finished
adding tables and queries to the Relationships document tab, click Close.

6. Drag a field (typically the primary key) from one table to the common field (the
foreign key) in the other table. To drag multiple fields, press the CTRL key, click
each field, and then drag them.

The Edit Relationships dialog box appears.

7. Verify that the field names shown are the common fields for the relationship. If a
field name is incorrect, click on the field name and select the appropriate field from
the list.

_____________________________________________________________________ 25
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
To enforce referential integrity for this relationship, select the Enforce Referential
Integrity check box. Finally Click Create.

Once we create table relationship we can update or delete already created relation as
needed.

Update relationship: changing relationship between tables.

a) R/click on the line joining the tables ----->edit relationship then change it as
necessary.

Delete relationship

1. R/click on the line connecting tables ------>select delete.

Types of table relationship


Before we create relationship we must consider referential integrity to prevent
orphan records
and to keep

_____________________________________________________________________ 26
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)
references synchronized so that you don't have any records that reference other
records that no longer exist. You enforce referential integrity by enabling it for a
table relationship. Once enforced, Access rejects any operation that would violate
referential integrity for that table relationship..
a. one-to-one relationship:
In this type of relationship, each record in one table can have only one matching
record in the second table, and each record in the second table can have only one
matching
record in
the first
table.
This type of

relationship is not common because, most often, the information related in this way
is stored in the same table. You might use a one-to-one relationship to divide a table
with many fields, to isolate part of a table for security reasons, or to store
information that applies only to a subset of the main table. When you do identify
such a relationship, both tables must share a common field.

b. one-to-many relationship

In this type of relationship each records of one table can have more than one
matching record in the second table. To represent a one-to-many relationship in
your database design, take the primary key on the "one" side of the relationship and
add it as an
additional field or
fields to the table on
the "many" side of
the relationship.

_____________________________________________________________________ 27
Set By: B.T Shashemene poly technique collage
SHASHEMENE POLY TECHNIQUE COLLAGE
INFORMATION TECHNOLOGY SERVICE MANAGEMENT(ITSM)

c. Many to many: In this type of relationship each records of first table can have
more than one matching record of second table and vice versa. To represent a
many-to-many relationship, you must create a third table, often called a junction
table, that breaks down the many-to-many relationship into two one-to-many
relationships. You insert the primary key from each of the two tables into the
third table. As a result, the third table records each occurrence, or instance, of
the relationship.

_____________________________________________________________________ 28
Set By: B.T Shashemene poly technique collage

You might also like