Ms Access Notes 6
Ms Access Notes 6
MS ACCESS
This is an application classified as database management system (DBMS). It is database tool
used to store, maintain and use a collection of information that is organized to serve a specific
purpose e.g. Customer records, Personal records, Library records, Hospital records, School
records e.t.c
DEFINATIONS
Record: This is a complete detail about an entry; normally entered in a row in a datasheet
view of a table, queries or forms e.g. name, date of birth, country of origin.
Object: These are programs (modules) that controls the layout presentation of the data e.g.
Filters (query), a table, query, form e.t.c objects that are defined by the system information
from another application such as a chart (graph), a table that can be linked or embedded.
Primary key: This is a unique field whose value uniquely identifies each record in a table. It
gives records their identity.
A primary key may be referred as a foreign key in another table
Microsoft Access Window
It’s divided into 2 parts
1. Application window
Comprises of;
Application title
Menu bar
Tool bar
Status bar
Control buttons
2. Database Window
It comprises of;
Objects
Selection tabs
Command buttons
Control buttons
Scroll bars (open object)
Application window
Database Window
window
Designing a database
Considerations
Data integrity
Relationship between fields
Data and fields duplication
Object sizes
Creating a database
Open Ms access
Click on File on the menu bar
Point to New and click
Select Blank database and click
Enter the name in the File new Database dialogue box, choosing the location to save
in
Click on Create
TABLE
- This is an object used to present data
- Data is entered in tabular form
- Data is categorized under the following types;
Text - Data with text or combination of text and numbers
Memo - long text entries with both alphabetic and numeric characters
Number - Numeric entries
Date/time - Chronological entries
Currency - Monetary values
Auto number - automatic listing numbering
Yes/No - Indicates whether a statement is true or false
OLE Object - Graphics and pictures
Setting field properties of a table
- This are set of properties used to decide how data in the field should be stored or
displayed
- This is also used to prevent incorrect entries
- Examples; You can control the maximum number of characters or letters that can be
entered in a text field by setting its field size property
- For date/time field, specify a format form
- For number or currency fields, specify the number of decimal places e.t.c
Creating a Table
Procedure
In the database window, select Tables tab
Click the New button on the menu bar
The New Table dialogue box appears
Select Design View and click O.K
The design window appears
Enter the Field Names, Data Types, and Description if necessary.
Close the design window and click yes to save the table
Enter the name and click O.K
Linking tables
Importing tables leads to creating a separate copy which is then imported into the current
database.
Incase memory is limited; creating such copies may lead to lack of space in such instances the
user can use the link option instead of import option.
The link option provides a way of opening a table which would otherwise be imported when
the user is in the current database.
QUERY
- This is a question about data that is stored in the tables.
- The output got after filtering is an example of a query
- Apart from viewing the record, a query can also be used as the source of data for
creating a form or a report.
- Can also be used to
Update records (calculations)
Select and display particular records (filtering)
Ask and answer quiz about your data
Arrange or sort records
Creating a Query
Procedure
While the database window is open, click on the queries tab.
Double click on Create Query in Design View.
The show table dialogue box appears, add the tables and close.
Ent
er
the fields to be used in the query.
Type the criteria under the relevant field
If there are any fields that will not be shown in the output, un-check them, i.e. in the
row for Show click on the check-box to remove the tick sign.
To view the output after setting the criteria, click on the Datasheet View button or the
Run button.
Setting criteria
Decide on which record you want to show and which you want to use as a determining factor.
Type in the function which will filter only those particular records of interest e.g. you may
need to display the list of people who earn more than Kshs. 20,000 in this case the field to
filter is salary and the function is >20,000.
Other Criteria are:
> Greater than
< Less than
= Equal symbol
>= Greater than or equal to
<= Smaller than or equal to
<> Not equal to
*Represents more than one character
? Represents one character
Run
Saving a query
Procedure
Close the query window
Click on yes to save the query
In the save as dialogue box enter the query name and click O.K
RELATIONSHIPS
- This is a way of linking up tables to enable data to be shared among tables.
- They are normally created to curb the duplication of records especially when a query
is created using more than one table.
- A relationship can either be created from the tools menu, then click on the
relationship command or query design screen.
- Before a relationship is created ensure that there are field names having the same data
without which no relationship can be created.
- There are 3 types of relationships
a) One to one- where one record from a table A can only be related to one
record in table B e.g. a person has only one ID No.
b) One to many- where one record in a table A is relate to at least 2 or more
records in table B e.g. an instructor to the students, a doctor to the patients.
c) Many to many- where a record in table A or B can relate to many records in
other tables e.g. many customers may purchase many products and many
products may be purchased by many customers.
Steps of Setting up a Relationship
Click on the tools menu
Select or click on the relationship command
In the show table dialogue box click on the add button
Select the records to be linked and close
Click, drag and drop field from one table to the other (this is the field that the tables
have in common)
Ensure that the link is abided to field name with common data types
Click on create
Form
- A form makes viewing of records and entering of data into a table easier because it
uses controls such as Text boxes and Drop-down lists.
- Forms are easier to complete and to read because the labels used are more descriptive
than the field titles used in the tables. In addition you can add help information so that
the person using the form may know exactly where to place certain information e.t.c
Controls
- Everything that is added to a form or created on a form is described as a control e.g.
text boxes, list boxes (Drop-down lists), lines e.t.c. They are used to control the
information that is typed into the form, or determine how the form should look like.
Labels
These are descriptive items in a form, such as form title and the text next to a text box. They
describe the information to be entered in the text boxes or to be selected from the drop down
lists.
Text boxes
This is an area in which the information from the table appears or where the information is to
be entered.
Drop-down lists
This is a list box that contains a list of choices or options for the user to choose from. It can be
used to restrict entry to that particular text box.
Creating a Form
Procedure
Click on the form selection tab then click on new
Select the view (design view, form wizard, outoform: columnar, tabular, datasheet,
pivot table, pivot chart, chart wizard, pivot table wizard)
Select the table or query to use, then click o.k.
In case you are using the wizard ensure that you select the field (s) to include.
Select the layout format e.g. international. Give the form name and then click on
finish.
Outoform
A quick method of creating a form as Ms Access will automatically create all the controls and
position them in the form.
REPORTS
These are Ms Access objects and components used in
1) Print previewing
2) Analysis
3) Rearranging and grouping of data
4) Present data
Creating a report
Click on the report selection tab, then click on new
Select the view
Select the table or query to use, and then click o.k.
In case you are using the wizard ensure that you select the field (s) to include.
Select the layout format e.g. international. Give the form name and then click on
finish