Access Notes
Access Notes
(DATABASE APPLICATION)
Microsoft access is a program that allows you to create and manage databases.
What is database?
DATABASE is collection of related data. Or database is a place where you can store information
related to a specific topic. A Microsoft access database is made up of several components
including
1. TABLES
2. QUERIES
3. FORMS
4. REPORTS
=>FIELDNAME
Fieldnames are the smallest chunk of information in any record. Field name is the name of the
column.it should represent the contents of the field such as name, address, final grade, first name,
last name, age, gender, date etc. the name of the field cannot exceed 64 characters in length.it
many include spaces. The use of space in field name is not a good practice.
=>DATATYPE
the data type specifies the type of data that can be stored in the field. Common datatype in MS
access is number, text, currency and date etc.
1
Date/time Date and time values for the years 100 through 9999
=>FIELDSIZE
Field size is used to set the number of characters required in text or number field. Example: word
“KIBUNYUFU” has 9 characters, so the size of KIBUNYUFU is 9. It can be entered only in the
field name that has field size 9 or above.
DATASHEET VIEW- used to enter data all two ways found in VIEW command
STEPS
1. Click view
2. Click design view
3. Write your table name
4. Click OK
5. Set fieldname, Datatype, field size and other setting.
Example-01
Open Microsoft office access then create database called CAMPALA OPEN SCHOOL
then create table called STUDENT.
2
Gender Text 20
Country Text 30
Date reg Date/time -
Password Text 8
Citizenship Text 20
Student ID First name Last name age gende country Date reg password citizenships
r
DCC111 Zawadi Juma 56 Male Tanzanite 1/4/2017 2222222 tanzanians
DCC222 Helen john 34 femal ghana 2/4/2017 333333333 tanzanians
e
Required
Set input mask in the field password as xxxxxx and date reg as dd/mm/yyyy.
Set lookup wizard data type in the field gender and country.
Set validation text (“tafadhali ingiza wenye umri Zaidi ya miaka 18”)
Set validation text “please!!!Enter only eight digits “in the field password.
3
Set validation text “please!!!!Enter year before 2024”in the field date Reg.
i. YES, means you must enter the data in that field without skip.
ii. NO means you may enter data in the field without any problem
Input mask
An input mask is a string of characters that indicate the formats of valid input values. You can
use input mask in the table fields, query fields and controls on forms and reports. The input mask
is stored as an object property.
The example in the following table demonstrates some ways that you can use input masks.
DEFAULT VALUE
Default value is the values that appeared automatic in the field without interred. when you set
data in the field as default means you can’t enter otherwise it appeared automatic in that field.
The Microsoft access lookup wizard is a very useful feature. It appears as one of the field data
types, and is used for field which have a restricted list of possible values.
4
ii. MERITAL STATUS (Single or Married),
iii. COUNTRY (All list of countries) etc.
VALIDATION(Limitation)
Validation has two parts
i. Validation rule
ii. Validation text
Validation rule is rule that prevent bad data being saved in your table.
Validation text is message appeared when you enter a bad data in the table.
Validation rule and validation text examples
A primary key is the first field in each table of the database. Or a primary key is a field or set of
fields with value that are unique throughout a table. Values of the keys can be used to refer to
enter records, because each records have a different value of the key. Each table can only have
one primary key. Access can automatically create a primary key field for you create a table.
5
RELATIONSHIP
A relationship helps you to combine data from different tables. In an access desktop database,
you can create a relationship in the relationship window.
Types of relationship
i. One-to-one relationships
ii. One-to-many relationships
iii. Many-to-many relationships
STEPS TO CREATE
i. One the database tools tab, in the relationship group.
Queries
6
Another database object is called a query. A query allows you to retrieve information from one
or more tables based on a set of search conditions you define using the table fields. for example,
if you want to know the name of the employee that has employee ID “BML007”, you could
create a query that would retrieve information from multiple tables to determine the answer.
STEPS
NB: use primary key to ask variations of a question by using parameters like
[…………….:]
Example
FORMS
A third database object is a form. Forms are an access tools that users can create to make data
entry in database table easier. Entering data directly into a table can be difficult if there is a lot
of information to enter. Like an access spreadsheet, an access table is essentially a screen field
with blank rows where a user enters records.
STEPS
REPORTS
The final database object is the report. A report is an effective way to analyze and
present data using a specific layout. The text can be formatted in an access report,just
like it can be in word documents
8
a. Click create tab
b. Go to reports group, click report wizard.
c. Move the field to include on the report from the available fields list box to the
selected fields list box. To move all fields at once, click>>.
d. Click next>.
e. Click next>.
f. Click next>.
g. In the layout field, select the format of the report. Your options are “stepped”,
“block”, and “outline”. (Try the option to see a preview of the report layouts.)
h. In the orientation field, select whether to lay out the report in portraits or
landscape mode.
i. If you want all fields to fit on a single page, ensure the adjust the field width so all
fields fit on a page check box is marked.
j. Click next>
k. Enter a title for the report.
l. Select an option for the view you want to open the report in. your option is:
i. Preview the report (opens in print preview mode).
ii. Modify the report’s design (opens in design view).
iii. Click finish.
SWITCHBOARD MANAGER
Create a switchboard
i. On the database tools tab, in the database tools groups, click switchboard
manager.
ii. Microsoft access asks if you’d like to create a switchboard, click yes. this creates
a main switchboard.
9
Form
Text: write name of your form
Command: select open form in add mode
Form: select your form
NB: repeat the same steps according to the number of your form
REPORTS
10