MS access
MS access
Microsoft access is a database tool or package which is used to prepare, organize and maintain,
usually very huge and complex amount of information
Benefits of access
Large virtual storage for the data
Easy maintenance
Accurate updating
Fast retrieval of well-organized information
Application of access
Organization of customer addresses and their details in postal and telephone agencies
Organization of plight information
Organization and maintenance of employee records in the place of work
Preparation and organization of books details in the library
Preparation of basic programming
Example of other databases
Fox pro
Dbase
Paradox
Fox base
Oracle etc.
LOADING MS ACCESS
Method 1
Click start
Point all program
Point Microsoft office
Click Microsoft access
Common terms used in MS access
Database
This is a single file in MS access that can be saved as a single unit of data. The database shall
consist of all the components of MS access together with their respective data.
Database window
It is the window that appear when you open access database or an access project. The window
displays shortcuts for creating a new database object/ components and opening existing ones.
Design view
It is the window that shows the design of this database object or components I. e the table,
queries, forms, report, etc. within the design view the user can create new database objects and
also modify the design of existing ones.
Design grid
This is the grid or table that is used to design/ and modify a query or filter in query design view
or the advanced filter/ sort window. On this table the user places the required field, criteria,
expression etc. for a inquest.
These are filtered records or the results which are returned after the database has been questioned
for specific records using a query.
Structure query language
Datasheet
This is the working area that contains the actual data within the components and to be specific
table. The datasheet is portioned into columns (fields) and rows (records)
Components of MS access
These components are also referred to as database objects. They are small programs that handle
specific data in a database though the data is related they include;
The table
The quires
The forms
The reports
The macros
The modules etc.
The table
It is the basic components of MS access that holds data in fields (columns) and records (rows).
Table may also be referred to as file for it holds basic data: it can be opened, closed, copied,
renamed, deleted etc.
The field
It is a column within the table with similar data about an entry such as person, a place, an event,
a item etc. for instance
If a table has field named city it is expected to have a list thus: London, Nairobi, Paris etc. and
not £500. When typing the field name, it accommodates up to 64 characters.
Records
This is full collection of details about an entry in a table always running in a row e.g. id no,
gender, age etc.
Primary key
This is a special field that is established to:
Automatically increment a record after a previous one
Check any duplication of records
Automatically creare linking joint between or among the tables or queries in relationship.
Set up the primary key
Method 1
Open the table
Click home tab
Click view and select design view
Select the field to make primary key
Click design tab
Click primary key
Save the changes
Close the table design view
Method 2
Open the table
Click home tab
Click view and select design view
Right click the field to make primary key
Click primary key
Save the changes
Close the table design view
Remove the primary key
Method 1
Open the table
Click home tab
Click view and select design view
Select the field to make primary key
Click design tab
Click primary key
Save the changes
Close the table design view
Method 2
Open the table
Click home tab
Click view and select design view
Right click the field to make primary key
Click primary key
Save the changes
Close the table design view
Data types
Data types is an attribute given/ attached to field so as to check and determine the kind of data
that should be contained in the field. Each data type is again accompanied by a number of
properties.
Example of data types
Text
it determines or allows
Labels e.g. Pete, Nairobi etc.
Value e.g. 9012, 45.45 etc.
Alpha numeric e.g. p.o box 500 mks etc.
This data type can allow or hold up to 255 characters including spaces. in most instances, when
no data type is chosen, text is returned as a default data type in a field.
Memo
Determine alpha-numeric data i.e. both value and labels that run into several sentences. it can
hold up to maximum of 64000 characters including spaces.
Number
Determine numerical entries especially for only the mathematical/ calculation and not monetary
values e.g. 13003 etc.
Currency
Determine data with monetary value e.g. kshs 250, £300 etc.
Dates and time
Determine chronological entries e.g. 3/5/2015, 3pm etc.
Yes or no
This data type evaluates two conditions that could results to true or false, on or off. The field
with data types shall be shown in boxes. To choose a check box is clicked to show tick inside. To
remove the tick click again and it disappears.
Auto-number
it is a numerical value MS access shall automatically increment each time new record is entered.
it is ideal when entering serial numbers.
OLE Object
OLE stands for Object Linking and Embedding. The data type is used to determine inserted
graphical data such as charts, pictures, etc. within the field.
Field size
This allows the user to set the limit to the number of character that a field should accommodate.
E.g. text data type may take 30, 15, 125 etc. number data type may take integer, long integer etc.
Format
This property will determine how information will appear on screen or print out. E.g. number
data type may have currency, scientific, percentage, etc. formats. The date/ time data type may
have long date, long time, short date, short time etc. formats.
Decimal places
For currency or number data types the user may choose a number of decimal place for the values.
input mask
When chosen or set the input mask automatically puts dates in a specific format.
This can be evident in many values found in phone number e.g. 000-000-000000 setting will put
the phone number 254733888222 as 254-733-888222
Caption
This is more detailed information about a certain field for instance student Name could have its
caption as student, name
Default value
This is the value that is set or programmed to be automatically returned if the user does not enter
any value within a field e.g. the user does not choose any data type for a field the text data type
will automatically be inserted. Or the=date0 is a default value set to return the current system
date in a date field if none is indicated.
Validation rule
It is a logical expression which is set to specify which values are to be entered into a field and
also restrict others e.g.=o and =100 indicates that only value between zero and hundred are
accepted into the field.
Validation text
This is the message that should be returned in case the validation rule above, if it is violated the
message may be reported as ‘please enter a value between 0 and 100”
Required
This will determine whether a value must be entered within a certain field. This means the field
cannot be left blank. Notice this when choosing data types and try to leave it blank, you cannot
be allowed to continue
Allow zero length
Here the user is allowed to continue even without having to enter any value within a field. A zero
value will be seen in that field.
Indexed
As a property, indexed is set to check any duplication (double entry) of the same records.
RELATIONSHIP
Sometimes the user may need to create a query but the field to make the query could be in
different tabbies or queries. A relationship is therefore required in order to accomplish this.
Relationship is a way of linking up tables and queries to enable the data among the tables or the
queries easily and sensibly be shared. A relationship is normally created to avoid an absurd
duplication of records from unlinked table or queries.
Join lines
Join lines is the link that connects two or more tables or queries. A join enable MS access detect
and compare related information in different tables or queries and determines how to display the
requested information.
Concatenated query
This is refined and sensible query that is acquired after a relationship has been established among
tables or queries.
Cartesian product query
It is a non- sensible query obtained when a relationship is not established because there is a lot of
abnormal duplication of same records.
Steps to create a relationship
Open the database
Click tools menu
Click relationship
Select the table or queries
Click add button
Click close button
Drag a field from table A and place it on another in table B
Click create button
Repeat the above to join a third table a fourth and so forth
Save the relationship
Close the relationship window
You may create a query from the relationship
Points to note before creating a relationship
The join fields used to join two tables or queries must have same data types
Data types such as memo may hinder a query being created from a relationship
Sometimes a join created during query applies only for that particular query especially
joins are crated direct in the query design view
In some instance access automatically creates joins: That is;
a) If you have two tables and each table has similar fields with same data type and same
name and a relationship has been created between the tables
b) If one of the joined field is a primary key.
Method 2
Right click the field to sort
Click ascending or descending
FILTERING RECORDS
This is going into database to retrieve some records after supplying some criteria. Filtering in MS
access is normally done to the table. It is important for it helps retrieve specific records fast just
for reviewing at a glance. if the retrieval is often the query should be created.
Steps to filter records in table
Method 1
Open the table with the records to filter
Click records menu
Point filter
Click advanced filter/sort
Indicate the mode of sorting
Drag into grid the field
Type the criteria if any
Click filter menu
Click apply filter/sort
Method 2
Open the table
Position the cursor into the field with the aspect to filter by
Click the apply filter icon
To remove a filter
Method 1
Click records menu
Click remove filter
Method 2
Click the remove filter icon at standard toolbar
QUERIES
Query is one of the database objects. it is an electronic questionnaire that delves into the database
to filter specific records, if the records meet certain criteria. A query is made from an existing
table or from another existing query. They can be used to produce forms and reports. Queries can
also be used to perform calculation on records with the database.
REPORT
Report is a summary of details extracted from the database either from the tables or from the
queries
Like the form report display records in some grouping, some style and some layout. It can also
be used for calculation and setting expressions within the database.
Group footer
This section contains information that printed once at the end of the form or the report.
ACTION QUERIES
We already have dealt with queries. Those queries are known as select queries. We have also
learnt that queries delve into the database for specific data which meet a certain criteria or
condition. There are also other queries which go further than the select queries making changes
to the database. These are referred to as action queries. There are four action queries namely; app
and query, make table query, update query, and delete query.
Update query
This query can be used to make changes (update) to a database, for instance to increase
employees salary in job group A, B and C by a certain percentage, let’s say 10% or it can be used
to replace residents of Mombasa to Nairobi or even students indicated as not cleared to cleared;
within the database of course
Steps to update query
1. Click queries tab
2. Click new
3. Click design view
4. Click ok
5. Click the table/ query with fields to updates
6. Click add
7. Click close
8. Click query menu
9. Click update query
10. Drag the field to update into the grid
11. Type the expression that will update the records into the update to row
12. Type/ set the criteria to specify exactly which records to update
13. Click view menu
14. Click datasheet view
15. Click view menu again
16. Click design view
17. Run the query
18. Click yes to confirm the update changes
19. Save the update query design view
20. Close the design view
Append query
Append means add and therefore this query will be used to add more records into the database
usually several and specific at one go. This process may be important if similar tables exist
independently and there is need to make them one.
Steps to append query
1. Click queries tab
2. Click new
3. Click design view
4. Click ok
5. Click the table/ query to extract records to be appended
6. Click add
7. Click close
8. Click query menu
9. Click append query
10. Type/ select the name of the table into which to append new records
11. Click current database or another database
12. Click ok
13. Drag the field with records to be appended into the grid
14. Type the criteria to specify exactly which records to append
15. Click view menu
16. Click database view
17. Run the query
18. Click yes to confirm the append changes
19. Save the append query design view
20. Close the design view