MICROSOFT ACCESS
NTRODUCTION
Microsoft access is a database tool that is used to store and maintain a collection of
information that is organized to serve a specific purpose e.g. employee personal
information. Customers addresses ad details, students information etc.
Microsoft access is window based application. It helps in storing information about
different subjects in separate tables. It allows for creation of forms which automate
tasks queries and reports that help analyze data.
BENEFITS OF USING A DATABASE
➢ It makes it easy to maintain accurate and update data.
➢ It makes it fast to retrieve information because data is easier to fine.
➢ It makes it easy to analyze and make summary reports from stored
information.
➢ It makes it easy to protect your data from unauthorized personnel.
APPLICATION OF DATABASE
➢ Budget analysis
➢ Cash flow forecasting
➢ Bank account management
➢ Personnel record maintenance
➢ Address of books and diary maintenance
EXAMPLES OF DATABASE MANAGEMENT PRPOGRAMS
I. Dbase
II. Clarion
III. Fox pro
IV. Ms access
HOW TO START MS ACCESS FROM THE COMPUTER
a) Click the start button
b) Move to programs
c) Move to Microsoft access and click
COMPONENTS OF MICROSOFT ACCESS DATABASE ARE:
1. Tables
2. queries
3. forms
4. reports
5. macros
6. modules
DATABASE TERMINOLOGY
DATA
The material (stuff) that access store organizes and manages for you
FIELDS
The place where data is placed within the database. One field holds one place of data.
If you are storing g student details, possible fields would include name admission
number, age fees etc.
-1-
RECORDS
All the field for one student constitute a record. Record ensure which name relates to
which admission number, age etc
TABLE
A collection of records that describe similar data. A database for student details
could have tables for admission information. Fees exams etc
a) DESIGNING A DATABASE
A database is collection of related data.
1. Determine the purpose of the database. This helps in deciding the facts to be
stored.
2. Determine the tables. Divide the information into separate subjects such as
employee or orders. Each subject will be a table in the database.
3. Determine the fields. Decide what information to store in each table .Each
field is displayed as column in the table.
NB: When you create the Microsoft access database, you create one file that contains
the data and table structures as well as the queries forms reports, macros and modules.
CREATING A NEW DATABASE
Once Ms Access application is on, a dialog box appears with three options
a) Blank database
This allow for creation of self-designed database.
b) Database wizard
This provides a predefined set of databases where the user is free to customize them
according to the needs at hand.
CREATING A NEW TABLE
1. USING THE DESIGN VIEW
a) Select the table option and click on the new button
b) Select design view
c) Click ok
d) Enter the field name. Data type and description
e) Set the primary key by right clicking the field you want to set as the
primary key and the clicking primary key (optional)
f) Click file
g) Click save
h) Type the table name and click ok
i) Click view
j) Click datasheet view
k) Enter the records as required
l) Click file
m) Click save
-2-
FIELD NAME
These are column heading for the field in the table that you are creating.
DESCRIPTION
This column is optional but it can be used to give a detailed description of the fields
DATA TYPE
This is an attribute of a field that determines what kind of the field will store.
The following is a summary of all the field data types available in Ms Access their
uses and their storage sizes.
TEXT
Stores text or combination of text and numbers. Such as addresses. Numbers that do
not require calculations such as phone numbers, part numbers or postal codes of size
up to 255 characters.
MEMO
Store lengthy text and numbers such as general notes or detailed descriptions. Memo
fields hold up to 64000 characters of information
NUMBER
Numeric data to he used for mathematical calculations except calculations involving
money.
DATA/TIME
Stores dates and time.
CURRENCY
Used to store monetary values e.g. Ksh. $. Etc
AUTO NUMBER
Unique sequential (incrementing by 1) or random numbers automatically inserted
when a record is added.
YES / NO
Fields that will contain only one of two values such as YES/NO, true or false.
OLE OBJECT
Objects (such as Microsoft Word Documents, Microsoft Excel spreadsheets, picture
etc), created in other programmers using OLE protocol that can be linked to or
embedded in Microsoft Access table
PRIMARY KEY
What is a primary key? It is a field that is used to uniquely identify each record store
in table.
It is useful when you want to avoid entering duplicate records e.g. in a college it is the
student ID that uniquely identifies a particular student and his details.
-3-
ADVANTANGES OF A PRIMARY KEY
➢ Creates relationship between tables for automatic association of data in
separate tables correctly.
➢ It faster to find and retrieve data from table with primary key.
➢ It’s flexible to make changes or update data from tables with primary keys
than with tables without primary keys.
CREATING A TABLE USING THE BLANK DATABASE OPTION
In the database window click table.
a) Click new
b) Click datasheet view
c) Click o.k.
d) Rename the fields by clicking format then rename column e.g. name,
registration number, fees etc.
e) Enter the records.
f) Click file
g) Click save
h) Click yes if you want to set a primary key or no if you don’t
i)
CREATING THE TABLE USING THE TABLE WIZARD
a) In the database window click table
b) Click new
c) Click table wizard
d) Click o.k.
e) From the sample tables select the kind of table you want eg employees,
customers, suppliers, students etc.
f) Select the fields you want for your table
g) Click next
h) Type the name of the table
i) Click finish.
SORTING A DATABASE
a) Click the column heading that you want to sort
b) Click records
c) Click sort
d) Choose either ascending or descending
RETRIEVING A DATABASE
a) Click file
b) Click open
c) Choose and click the file to be retrieved
d) Click open
e) Select the table and click open
CLOSING A DATABASE
a) Click file
b) Click close
INCREASING THE COLUMN WIDTH
a) Place the cursor to the column to be increased or decreased
b) Click format
-4-
c) Click column width
d) Type the width desired
e) Click o.k.
NB; you can also increase or decrease by dragging with the mouse
FINDING AND REPLACING TEXT
a) Click the column that contains the word you want to replace
b) Click edit
c) Click replace
d) In the find what box type the word to be found
e) In the replace with box type the word to replace it with
f) Click replace or replace all
g) Click yes
h) Click close
TO CHANGE THE TEXT INTO BOLD, UNDERLINE, ITALICS COLOUR etc
a) Select your database
b) Select either bold, underline, italics etc from the formatting toolbar.
QUERIES
A query helps us to ask a question about the data store in the tables. Queries are used
to view, change and analyze data in different ways. That can also be used as the
source of records for forms and reports.
WHY USE QUERIES
We need queries when we want to ask questions about data stored in our tables
HOW DO THEY HELP US?
➢ In choosing fields
➢ In sorting records
➢ Performing calculations – can create fields and add data to them.
CREATING QUERIES
In the database window click queries
There are two options you can use to create a query;
(a) Design view – this is used when you want to create a query yourself from
scratch.
(b) Query wizard – this is used when you want to create a query using the
wizard.
(a) CREATING A QUERY BY DESIGNING IT YOURSELF
PROCEDURE
i. In the database window click on query.
ii. Double click the design view option or click new then click design view then
OK
iii. Ms Access opens a select query window and displays the add table dialogue
box, which lists all the tables in your database.
iv. In the add table dialogue box double-click the table that has the data you want.
v. Click close
-5-
vi. Double click the field you want in the table’s field list. The field appears in the
grid. You can also add a field by dragging it from the table’s field list to the
cell in the field row.
vii. Type the criteria you want in the criteria box.
viii. Click query then run or click the query button from the tools bar.
CALCULATED FIELDS
Ms Access allows the user of wild cards in setting criteria for viewing records.
E.g.: to view student’s details whose surname begins with letter M
1. Select the surname field
2. Type M* or like M* at the criteria option
3. Run the query
CREATING A QUERY USING A SIMPLE QUERY WIZARD
a) Click on query in the database window
b) Choose a new button and click
c) Choose simple query wizard and click OK
d) Select the table that you want to base your query on and click
e) Select the fields you want to show and click next
f) Answer the questions the computer is asking you and click finish
NB; the query is going to be displayed showing only the selected fields.
FORMS
A form is a collection of data chosen and written in specific way. One can use a form
to add and edit the information. Basing your output on either the table or queries can
create the form.
CREATING FORMS
In the database window click form
There are two options that you can use to create a form
(a) Design view: this is used when you want to design the form yourself and then
add controls and other design features you require.
PROCEDURE
i. In the database window, click from button and then choose the new
button.
ii. Click design view.
iii. In the select query/table box, select the table or query of the forms
source table or query
iv. Click OK
v. Ms Access displays the form window in design view where you can
create a custom layout by dragging the fields inside your form.
vi. Save your form
vii. To view the records, close the form in design view and then double
click it in the database window.
(b) FORM WIZARD
Ms Access has a form wizard which asks you questions about the form you want to
create, then creates a form based on your responses.
TO CREATE A FORM USING A FORM WIZARD
i. In the database window, click form button
ii. Click new
-6-
iii. Choose form wizard and click
iv. In the select a table/query list select underlying table or query and click OK
v. Follow the direction in the form wizard dialogue boxes by answering the
questions the computer is asking you.
vi. Click next
vii. Type the name of the form and then click finish. Your form will be displayed.
REPORTS
A report is information that is organized and formatted to meet your specifications.
It gives a way to retrieve and present data as meaningful information for use and
distribution.
PURPOSE OF A REPORT
➢ Reports are an effective way of presenting information to be distributed in
printed format e.g. font style & font size.
➢ Data can be organized and grouped into categories with sub-totals making it
easier to read.
➢ Graphs can be incorporated into the report to make the report more
meaningful.
CREATING A REPORT
You can create a report by using either;
Design view; this is used when you want to design the report yourself.
Report wizard; this is used when you want to create a report using the report wizard.
CREATING A REPORT USING THE REPORT WIZARD
a) In the database window, click the report button
b) Choose the new button then click report wizard
c) From the select a table/query list, select an underlying table or query and click
OK
d) Select the fields to appear on your report from the list of a available fields.
e) Click next
f) Select the fields for grouping if required.
g) Select the fields to sort by.
h) Choose the layout for your report. You can also change the page orientation
for the report to landscape if you have many fields.
i) Select the look & style you would like for the report
j) Click next
k) Type the title for the report and click finish
NB; Your report is going to be displayed
-7-