Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
63 views102 pages

Databases

Uploaded by

tum chris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views102 pages

Databases

Uploaded by

tum chris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 102

DATABASES

SECTION A (THEORY)

Database is a collection of logically organized data structures for ease of access and retrieval.

Database management systems (DBMSs) are specially designed software applications that interact
with the user, other applications, and the database itself to capture and analyze data. A general-
purpose DBMS is a software system designed to allow the definition, creation, querying, update, and
administration of databases.

Examples of database management software.


1. MS- Access
2. Fox Pro
3. Oracle
4. Database II, III, III, IV
5. Lotus IV.
6. Paradox.
7. SQL

Functions of Database Management Software (DBMS) or access.

1. Allows the user to add or dilute records (forms).


2. Updating or modifying existing records.
3. Organize data for easy access.
4. Acts as an interface between database and other application programs.
5. Ensure security for the data in database by safeguarding it against unauthorized access and
corruption.
6. It is used to keep statistics of data items in a database.

Database Objects.
Features of database management software:

1. Table.
This database is used to hold related tables are organized in row and columns with each row
representing a record while Column represents common fields in each record.

2. Queries and Query Language.


It is a power of a database or a tool that is used to search for or question a database on specific
records.
In MS Access the returned result in a query is known as a Dynaset.
The quer5ies statement or a written using structured query language. The user create query by writing
a structured query language statements.

3. Forms/ screen input.


It is a graphical interface that resembles the ordinary paper form used to collect data. However a
database form enables the user to view and enter data into a table.

4. Reports.
This is a tool that provides the user with the ability of generating reports from underline tab query.

5. Micro.
Makes the user to automate frequently perform procedures or tasks e.g. if you frequently uses a
particular form when you start database program you need to create macro that automates the opening
retrieve and then click restore on the file menu.

W. A. Kenyagah 1
Data organization on a database.
One of the functions of the database system is to organize data for easy access retrieval and
manipulation.
Data is organized from the simplest form called a field to a very complex structure called a database
fields.
1. Record – is a collection of related fields that represent a single entity e.g. A record in a
student report card that may contain the students name, Adm, No, Class Total Marks, Average
and Grade.
2. Table/files – is a collection of related records e.g. the students file in a school database
contains the details of all the students in a school.
3. Database -This is the highest in data organization her achy that holds all related files or tables
e.g. school database may contain student and staff table files.

MS – Access Screen Layout.


MS- Access window has a title bar, menu bar, tool bar and status bar instead of having a work area
like that of MS -Word or Excel, it provides the user with an object window from which you choose
the type of an object to work with such as table forms reports etc.

Exiting from MS Access.


o From the file menu, click exit or simply click the close button on the title bar.
o From new table dialog box, select design view.
o Using the grid displayed, enter a unique name for each field in the table.
 A field name must start with a letter and can be up to maximum of 64 characters including
letters, numbers, spaces and punctuation on marks.
 Choose the correct data type by adding the next field. By default, MS- Access insert as a data
type.
 To save the table, save button on standard tools bar or save from the file menu.

Description of Data Types.


The type of data to be used in a database must be clearly defined for the purpose of manipulation and
storage e.g. if a field is to be used for calculation it must be defined as a number.

W. A. Kenyagah 2
Data types in MS Access include.
1. Text-includes alphabetic letters, numbers, space and punctuation. It is used for fields that do not
used for calculation such as names places identification numbers etc. it accommodates a max of 255
characters.
2. Numbers –These are fields made up of numeric numbers 0-9 that are to be manipulated
mathematically.
3. Memo –This is a field made up alphanumeric data instead of using text use this data type if you
need to enter several paragraph of text coz it accommodates a max 32,000 characters.
4. Date/time- Used to identify afield as either date or time. This is coz date /time values can be
manipulated mathematically in a database e.g. you can calculate the age of a person from the date of
birth to the current data.
5. Currency –Used to identify numeric values that have decimals or fractions used especially when
dealing with monetary values such as Balance, Amount Sold etc...
6. Auto number- Is a numeric values used if you wish MS – Access to automatically increment the
values in a field e.g. when entering a list of forty students and you have afield labeled stud no, the no
will increase by one every time you enter a new record.
7. Yes/ No.-Is a logical field where an entry is either a yes or No true or false e.g. a field may require
you to answer whether you are a male or female.
8. OLEobject – OLE stands for (Object Linking and Embedding). It is mostly used with graphical
user interface apps for inserting graphical objects such as pictures, drawing, charts etc...

FIELD PROPERTIES.
The field properties depend on the type of field selected .The various properties are;
1. Field size.
This allows the user to set the number of characters in the field instead of the default 50 for text fields
for numeric field’s integer and along integer.
Integer and long integer - Accepts numbers with no decimal.
Single and double - accept numbers with decimals.
2. Format- Determines how information appears in the screen and when printed e.g. you can format
the number in scientific, currency, percentage or general format.
3. Decimal places.-For numbers and currency fields you can specify the number of decimal places.
4. Input masks- Automatically formats the field entry into a specified format e.g. if you enter a
number as 0200100409874 and the input mask is a set as 00200000-000000, it is automatically
displayed as 020-(00100) - 409874 names><>?????? “>? <????
5. Caption. - This is more description name for the field to be used in a table or a form display.
6. Default value- A value that will appear automatically in the data sheet or form if nothing is entered
by the user to change it.
7. Validation text – The message that appears once the validation rule is related.
PRIMARY KEY- INDEXES.
An index- Is a database feature used to speed up search and fort operations in a table.
Primary key- Is a special index hat enforce uniqueness in a table so that one record is not entered
twice. Once a field is set as primary key. Its datasheet is automatically indexed or sorted using the
primary key.

To set a primary key.


Open the table in design form.
Select the fields you want to set the primary key by clicking into the row header should appear to the
left of the field name.
Click set the primary key button. A key should appear on the left field name.

W. A. Kenyagah 3
TYPES OF CONTROLS.
BOUND: Is one whose source of data is an active field in table or query.
UNBOUND: Is a control that is not connected to any data source.

CREATING A FORM LAYOUT USING FORM WIZARD.


Using the form wizard you can create either a columnar, tabular, datasheet or justified form layout.
Columnar: The fields for each record are displayed down a column.
Tabular: Records are displayed on left to right across the page and labels appear at the top of each
columns and each row represents a new record.
Datasheet. The form resembles a table datasheet view.
Justified: One record occupies the whole form.

USING QUERIES.
Queries are the fastest way to search for information in a database.
A query is a database feature that enables the user to display specific records as well as person
calculates on fields from one or multiple tables.
You can analyze a table or tables by using either a select query or an action query.

SELECT QUERY.
This is the most common type of query used for searching and analyzing data in one or more tables.

ACTION QUERY.
These are query that are used to make changes to many records once. They are mostly used to delete,
updates, add a group of records from one table to another or create a new table from another table.

TYPES OF ACTION QUERIES FOUND IN MS-ACCESS.


i. Update- update data in the table.
ii. Append Query- Adds data in a table from one or more tables.
iii. Make table query- creates a new table from a Dynaset.
iv. Delete query- deletes specified records from one or more tables.

Creating a select query.


1. Ensure that the database you want to create a query for is open.
2. Click the query tab, then new.
3. From the new query choose either to create a query form in design view or using a wizard.
4. To design from scratch, click design view.
5. Click the table from query list and then click add.
6. Click close to close the show table.
7. The query design grid opens in MS Access is called Query-by Example.

Parts of a Query Grid.


- Field row: Field from a table to be used are arranged in this row.
- Sort row: By clicking the down arrow in the sort cell you can specify whether to display the
field in the query results when the box is not checked the field is not displayed.
- Criteria row: Conditional statements are typed that will be used by the query to display
specific records.
- Or row: used to specify an alternative.

To add fields into the query grid.


Open the query in design view.
- From the field list of the underlying table drag each field and place it in the field row.

Specifying the search criteria.


- Enter a conditional statement or statements in the criteria row e.g.> 500 in a salary column
can display all employees earning more than sh. 5000.

W. A. Kenyagah 4
To define criteria- use either rational or logical operators.
Relational operators- include less than< greater> greater than or equal (>=) less than or (<=) not
equal to (<>) and equal to (=)
Logical operators- include and or and not.
1. And- To display values in a specific range e.g. to display records from employees table with
salaries above 4000 but less than 6000 type>4000 but less than and <6000 on the criteria row in
the salary column.
2. Or- To get either one of two values e.g. employees either in Nairobi or Embu.
3. Not: used to list all records except those that you do not want to see e.g. Not 6000 all records
will be displayed except 6000.
OTHERS
Between- used to display data in a particular range e.g. instead of typing>4000 and <6000 type
between 4000
And 6000.
Like: To display records you are not sure of the name at least you can remember a few characters
used like wildcards.
Wildcards- special symbols mostly an asterisk and question mark used in a place of other character
e.g. to display all names starting with “Sm” type like Sm?
Using total functions
With a query you can analyze all records field using the inbuilt functions such as Sum, aver, min and
max.
i. Open your query in design view.
ii. Click the totals button the query toolbar
iii. Select the fields you want to be analyzed.
iv. For each field to be analyzed, click its cell in the total row, and then select any of these
functions.
Sum: adds all the numeral data items
Average: Calculate the mean of all numeric data item in the field column.
Min: Returns the min value from the field column.
Max: returns the max value from the field.
Count: returns the number of items field column.
v. Set criteria and other options then click run to preview.
vi. Save the query.
Printing a query.
i. Open the database window of the database containing the query you want to print.
ii. Click the query tab then the query you want to print.
iii. From the file menu, click print.
Creating a select query from multiple tables.
Types of relationships.
i. One To One
ii. One to Many.
iii. .

In a One-To-One Relationship for a particular field in one table .there is only one matching record
in the related table and vice versa.

In a One-To-Many Relationship in a particular field in one table there are several matching records
in another table.

In a Many To Many Relationship in a particular records in one table there are several matching
records in the other table and vice versa.

W. A. Kenyagah 5
Defining a relationship between tables.
i. Make sure your database is open.
ii. From tools menu, choose Relationship.
iii. Select the tables to add then click Add button.
iv. To create Relationship click on common field and drag it to the second table.
v. To Enforce Referential Integrity, right click.
vi. The line joining to two tables then click edit
vii. Make sure enforce referential integrity is checked to ensure all records entered in the related
Table exists in the primary table.
viii. Click ok.

To create a query based on related tables.


i. Start the database windows and click queries
ii. Delete design view and click ok.
iii. Click the table you want to base your query on show table dialogue box then click add.
iv. Relationship between various tables will be displayed.
v. Save and run the query.

Creating reports.
Reports are used to summarize and present information from a database.
A good database software should enable the user to generate database reports and present them for
presentation and distribution .This process is referred to as Formal presentation.

Parts of a report layout in design view.


1. Report header-This contains unbound controls that display title of the report.
2. Page header- contains headings or labels data items to be displayed in every column.
3. Page footer- Holds controls that is to be displayed on every page such as the page number and
date e.g. Mon displays the correct date and time as set in the system click.
4. Detail- Holds bound controls that displayed data items for the table or query it was created from.
5. Report footer- used for display summary from a report such as the grand total for a numeric data
in a particular field column.

Creating a report using report wizard.

To create a report layout.


i. Open the data base.
ii. Click the report tab then new.
iii. From the new report dialogue box, click report wizard then ok.
iv. Select a data of query then the field add to the report then click next.
v. The wizard asks you whether you wish to add any group. Grouping is used to categorize
records using a particular field for better presentation or if you need to perform calculations on a
group of common items E.g. to categorize books in library database. acc. 15BN numbers, double
click the field then click next.
i. In the dialogue box, select the sort option.
ii. If u want to sort the records you can also click the summery options button in case you want to
perform e.g. sum, range.
iii. Then click ok to close the summery option dialogue box then next.
iv. From the layout dialogue box, select the type of layout such as stepped, block etc. select the page
orientation i.e. either portrait or landscape then click next.
v. In style dialogue box, specifying the report style by either selecting bold, casual etc.
vi. Finally enter the name of the report then click finish. The report will be displayed on the screen
in print view mode.

W. A. Kenyagah 6
Creating a report in design view.
i. In the database window click the report tab then new.
ii. In the new report dialogue box click design view.
iii. Click the name of the table or query u want to generate a report from.
iv. Click ok button you will get a report design when you can get data controls.
v. From the view menu, click record list.
vi. To design the layout drag each field from the field list to the layout grid and drop it where u
want the date column to appear.
vii. Once you finish placing control click the save button.
viii. In the save as dialogue box enter the name of the report and click ok.

To modify labels.
i. From your database window, click the report tab the design view button.
ii. The table grid is displayed .Edit the layout as desired .Save and close the design grid.
iii. To view the report, click the print view button.

Modifying a report layout


To modify headers footer.
i. Open the report in design view.
ii. Click the report header and footer you want to modify.
iii. Make necessary changes then click save as button.
iv. Click print preview to view the changes.

To add more controls onto the report layout.


i. Open the report on design view.
ii. Display the field list button or using the new.
iii. Select one or more fields in the field list and drag view to the report design grid.

To resize or move a control


i. Click once to select it, position mouse printer on the place holder until the mouse point
changes to double side drag the pointer to resize control.
ii. To move a control select it and place the mouse pointer on the place holder until it changes to a
hard.

Creating labels
Labels- A sticker or piece of paper put on an item for the purpose of identification e.g. mailing labels,
labels on the floppy disk where you write your name e.t c.

To create a label using report wizard.


i. Open your database.
ii. From database window, click the input tab then new.
iii. From new report dialogue box select labels wizard on the tale are to be generated form.
iv. Label wizard report starts running.
v. From a series of dialogue boxes displayed specifying the label size, font of fields to be
included in the label whether to sort the labels, the name of the labels, the click finish.

W. A. Kenyagah 7
MICROSOFT ACCESS 2007
SECTION B (PRACTICAL)

Lesson 1: Getting Familiar with Microsoft Access 2007 for Windows


Ways of opening MS Access office 2007
1. Start -> (All) Programs -> Microsoft Office -> Microsoft Office Access 2007.

2. Start -> Run ->Type “MSACCESS” ->Press ENTER or Click OK.

W. A. Kenyagah 8
3. Right Click Desktop->New->New Microsoft Office Access 2007 Database->Press Enter
twice or Double Click the File.

4. Double click the MS Access Icon on the desktop (if available)

Microsoft Access is a database software package. A database is an organized collection of records.


Telephone and address books are examples of paper databases. With Access, you can create a
computerized database. For example, you can use Access to organize the students who attend a
school, the courses they take, and the instructors who teach them. After you create an Access
database, you can search it, manipulate it, and extract information from it. This lesson introduces you
to Access windows and teaches you how to create a database.

W. A. Kenyagah 9
Getting Started

You use Windows to interact with Access. To begin, start Access 2007. You screen will look similar
to the one shown here.

Northwind is a sample database you can download from the Microsoft website. I will use the
Northwind database to introduce you to Access windows. If the Northwind database is already on
your system, open it, otherwise download it and then open it.
To open Northwind:
1. Click the Microsoft Office button. A menu appears.
2. Click Open. The Open dialog box appears.
3. Locate the Northwind database.
4. Click the Open button. Access opens the Northwind database.

W. A. Kenyagah 10
To download Northwind, connect to the Internet and then follow these steps:

1. Click Sample. The Northwind 2007 icon appears in the center of the window.
2. Click the Northwind icon.
3. Click the Browse button. The File New Database window appears.
4. Locate the folder in which you want to save the Northwind database.
5. Click OK. The File New Database window closes.
6. Click Create. Access creates the Northwind database and opens it.

Understanding Security
It is possible for an Access database to contain malicious code, such as a computer virus. Access has
security settings that disable code and display a security warning when you open a database. If you
know a database is trustworthy, you can perform the following steps to enable it. You may need to
enable the Northwind database.

W. A. Kenyagah 11
To enable a database:

1. Click the Options button. The Microsoft Office Security Options dialog box appears.
2. Click Enable This Content.
3. Click OK. Access enables the content. If you are enabling the Northwind database, the Login
dialog box appears.

4. Click Login. Access opens the Northwind database.


If you know a database is safe, you can store it in a trusted location. Databases stored in trusted
locations do not require you to enable security.

To create a trusted location:


1. Click the Microsoft Office button. A menu appears.
2. Click Access Options in the bottom-right corner. The Access Options pane appears.
3. Click Trust Center.
4. Click Trust Center Settings.
5. Click Trusted Locations.
6. Click Add New Locations. The Microsoft Office Trusted Location dialog box appears.
7. Enter the path to the location you want to trust, or click Browse to locate the folder.
8. If you want to trust subfolders, select The Subfolders of This Location Are Also Trusted.
9. Click OK. The location is now a trusted location.
10. Click OK again.
11. Click OK. You have created a trusted location.

W. A. Kenyagah 12
The Navigation Pane
The Access window used in this example has been set up to make it easier to explain. This section
shows you how to set up your window so that it matches the example. If you are not already logged in
to Northwind, click the Login button.
An Access database consists of the following objects: tables, queries, forms, reports, macros, and
modules. The Navigation pane displays the objects in a database.

To manipulate the Navigation pane:

 Click the double right-arrows to open it. The arrows change to double left-arrows .
 Click the double left-arrows to close it. The arrows change to double right-arrows .
In this example, the objects are organized by type, which is not the default setting. You may want to
organize the objects in your database by type also. You can use the down-arrow on the top of the
Navigation pane to change the manner in which objects are organized.

To organize objects by type:


1. Click the All Access Objects button on the Navigation pane. A menu appears.
2. Click Object Type. Access displays the objects in the database by type.
The Access window with the Northwind database open is shown here.

W. A. Kenyagah 13
Note: Your window probably does not look exactly like the one shown. In Access 2007, the window
display depends on the size of the window, the size of your monitor, and the resolution to which your
monitor is set. Resolution determines how much information your computer monitor can display. If
you use a low resolution, you can fit less information on your screen, but the size of your text and
images are larger. If you use a high resolution, you can fit more information on your screen, but the
size of the text and images are smaller. Also, you can use settings in Access 2007, Windows Vista,
and Windows XP to change the color and style of your windows.

The Microsoft Office Button

In the upper-left corner of the Access window is the Microsoft Office button. When you click the
button, a menu appears. You can use the menu to create a new file, open an existing file, save a file,
and perform many other tasks.

The Quick Access Toolbar

Next to the Microsoft Office button is the Quick Access toolbar. The Quick Access toolbar provides
you with access to commands you frequently use. By default, Save, Undo, and Redo appear on the
Quick Access toolbar. You use Save to save an object, Undo to roll back an action you have taken,
and Redo to reapply an action you have rolled back.

The Title Bar

The Title bar is located at the top in the center of the Access window. The Title bar displays the name
of the database on which you are currently working.

W. A. Kenyagah 14
The Ribbon

You use commands to tell Access what to do. In Access 2007, you use the Ribbon to issue commands.
The Ribbon is located near the top of the Access window, below the Quick Access toolbar. At the top
of the Ribbon are several tabs; clicking a tab displays related command groups. Within each group are
related command buttons. You click buttons to issue commands or to access menus and dialog boxes.
You may also find a dialog box launcher in the bottom-right corner of a group. When you click
the dialog box launcher , a dialog box makes additional commands available.

Access Objects
To view or hide the objects on the Navigation pane:

You click the double down-arrows to view objects. The double down-arrows change to

double up-arrows .

You click the double up-arrows to hide objects. The double up-arrows change to double

down-arrows .
As stated earlier, the Navigation pane stores the objects in your database: tables, queries, forms,
reports, macros, and modules. Objects always display with an icon to the right. The icon tells you the

object type: table, query, form, report, macro,

and module.

W. A. Kenyagah 15
OBJECTS
Tables In Access, data is stored in tables. A table is a set of columns and rows, with each column
referred to as a field. Each value in a field represents a single type of data. Each row of a
table is referred to as a record.
Queries You use queries to retrieve specific data from your database and to answer questions
about your data. For example, you can use a query to find the names of the employees in
your database who live in a particular state.
Forms Forms give you the ability to choose the format and arrangement of fields. You can use a
form to enter, edit, and display data.
Reports Reports organize or summarize your data so you can print it or view it onscreen. You
often use reports when you want to analyze your data or present your data to others.
Macros Macros give you the ability to automate tasks. You can use a macro to add functionality
to a form, report, or control.
Modules Like macros, modules give you the ability to automate tasks and add functionality to a
form, report, or control. Macros are created by choosing from a list of macro actions,
whereas modules are written in Visual Basic for Applications.

You double-click an object to open the object. You right-click an object to view a menu of options.
You can use the menu to do such things as open objects, rename objects, and delete objects.
Objects that are open appear on tabs. Right-click a tab to view a menu of options you can perform,
such as save the object, close the object, or change the view.

Change Views

A view is a way of looking at an object. For example, in Access, data is stored in tables. Two of the
possible ways you can view a table are Datasheet view and Design view. You can see the data
contained in a table in Datasheet view. You can see the design of a table in Design view.

W. A. Kenyagah 16
When you open an object, buttons appear in the lower-right corner of the Access window. You can
use the View button on the Home tab to change views, or you can click the proper button in the lower-
right corner of the window.

Close a Database and Exit Access


This completes the introduction to Access using the Northwind database. The following describes
how you close a database and exit Access.

To close a database:
1. Click the Microsoft Office button. A menu appears.
2. Click Close Database. Access closes the database.

To exit Access:
1. Click the Microsoft Office button. A menu appears.
2. Click Exit Access. You exit Access.

Create a Database
When you start Access, the Getting Started with Microsoft Office Access screen appears. You can use
this screen to create a database. Within a database, you can do such things as enter data, create reports,
and retrieve data. You can create a blank database or you can use one of the templates provided by
Microsoft. When you use a template, Access creates forms you can use to enter data, reports you can
use to retrieve data, and more. You can modify the forms, reports, and other objects to suit your
needs. This tutorial will teach you how.
The following templates are included with Access: Assets, Contacts, Events, Faculty, Issues,
Marketing Projects, Projects, Sales Pipeline, Students, and Tasks. Other templates are available
online. Each template creates a database related to the title. For example, the Faculty template creates
a faculty database that includes tables, queries, forms, and reports related to faculty. In Access, you
use tables to store data, queries to retrieve data, forms to enter data, and reports to display data.

To use a template to create a database:

1. Start Access. The Getting Started with Microsoft Office Access screen appears.
2. Click Local Templates. Icons representing local templates appear in the center of the window.

W. A. Kenyagah 17
3. Click the icon for the template you want to use.
4. Click the Browse button. The File New Database window appears.
5. Locate the folder in which you want to store your database.
6. Click OK.
7. Click Create. Access creates and opens your database.

8. Open the Navigation pane. Access displays the tables, queries, forms, reports and other
objects related to the database you selected. You may wish to display the objects by type.

How do I create a database based on the templates that are found online?
Online templates fall into the following categories: Business, Education, Personal, and Non-profit. To
create a database based on one of these templates:
1. Start Access. The Getting Started with Microsoft Office Access screen appears.
2. Make sure you are connected to the Internet.
3. Click the category for the template you want to create. Icons representing Internet templates
appear in the center of the window.
4. Click the icon for the template you want to use to create your database.

5. Click the Browse button .


6. Locate the folder in which you want to store your database.
7. Click Download. Access prompts you.
8. Click Continue. Access downloads and opens your database.
9. Open the Navigation pane. Access displays the tables, queries, forms, reports, and other
objects related to your database.

How do I open an existing database?


1. Click the Office button. A menu appears.
2. Click Open.
3. Locate the folder in which you stored your database.
4. Click the database name.
5. Click Open. Access opens the database.
Tip: You can also open an existing database by pressing Ctrl-O and then following steps 3 through 5.

W. A. Kenyagah 18
Create a Blank Database
A blank database is a database with nothing in it. You must create all the tables, forms, reports,
queries, and so on. If you cannot find a template that suits your needs, create a blank database. After
you create the database, Access opens to a datasheet and makes available the tools you need to create
objects. Creating tables is the first step in building a database. You will learn more about creating
tables in the next lesson.

To create a blank database:

1. Start Access.
2. Click Blank Database.
3. Type the name you want to give your database in the File Name field. Access will
automatically append .accdb to the name.
4. Click the Browse button. The File New Database window appears.
5. Locate the folder in which you want to store your database. Note that the name of the file
appears in the File Name field.
6. Click OK.
7. Click the Create button. Access creates the database and opens a datasheet with the Table
Tools available to you.
Note the Table Tools in the upper-right portion of the Ribbon.

W. A. Kenyagah 19
What is a Datasheet?
In Access, data is stored in tables. A datasheet displays the information stored in a table in columns
and rows. The columns are called fields and the rows are called records. You can use a datasheet to
create a table, enter data, retrieve data, and perform other tasks.

Lesson 2: Creating Microsoft Access Tables


Tables are the foundation of an Access database. Access stores data in tables. This lesson teaches you
how to create a table, add fields to a table, assign data types to fields, and set field properties.

Understanding Tables
A table is a set of columns and rows. Each column is called a field. Within a table, each field must be
given a name and no two fields can have the same name. Each value in a field represents a single
category of data. For example, a table might have three fields: Last Name, First Name, and Phone
Number. The table consists of three columns: one for last name, one for first name, and one for phone
number. In every row of the table, the Last Name field contains the last name, the First Name field
contains the first name, and the Phone Number field contains the phone number. Each row in a table
is called a record.

All of the data in a table should refer to the same subject. For example, all of the data in the
Employees table should refer to employees, all of the data in the Students table should refer to
students, and all of the data in the Courses table should refer to courses.

You can view an Access database as a collection of related tables. For example, in a database that
contains tables for Employees, Students, and Courses, the Employees table lists the employees, the
Students table lists students, and the Courses table lists the courses students can take.

After Access creates a blank database, it opens in Datasheet view and makes available the tools you
need to create a table. Datasheet view displays a table as a set of columns and rows. When you view a
blank database for the first time in Datasheet view, you see a column named ID. This column is by
default the primary key field.
A primary key is a field or combination of fields that uniquely identify each record in a table. No two
records in a table should have the same values in every field. For example, the following should not
occur in a table.

Last Name First Name City


Smith John Jonestown
Smith John Jonestown

In the real world, it is possible to have two people from the same city with the same first and last
name. In cases like this, you can use the ID field as the primary key field and use it to make each
record unique. The ID field has a data type of AutoNumber; as a result, Access automatically creates a
unique number for each record in the database. The resulting table will look like the one shown here.

W. A. Kenyagah 20
ID Last Name First Name City
1 Smith John Jonestown
2 Smith John Jonestown

Access provides several methods for creating a table. One method is to use the Rename option with
the Add New Field column label to give each column the field name you want it to have and then to
type or paste your data into the table. Field names can include letters, numbers, and spaces and can be
up to 64 characters long. When choosing a field name, try to keep it short.

When you save your table for the first time, Access gives you the opportunity to name your table.
Each table name must be unique; hence, two tables in the same database cannot have the same name.
The table name should describe the data in the table; can consist of letters, numbers, and spaces; and
can be up to 64 characters long. When choosing a table name, try to keep it short.
You can save a table by clicking the Save button on the Quick Access toolbar or by right-clicking the
Tables tab and then choosing save from the menu that appears.

To add fields to a table:

1. Click the Add New Field column label.


2. Activate the Datasheet tab.
3. Click Rename in the Fields & Columns group.
4. Type the field name.
5. Press Enter. Access creates the field.
6. Type the next field name. Access creates the field. Continue until you have created all of the
fields in your table.
7. Press Enter without entering a field name to end your entries.
Or
1. Right-click the Add New Field column label. A menu appears.
2. Click Rename Column.
3. Type the field name.
4. Press Enter. Access creates the field.
5. Type the next field name. Access creates the field. Continue until you have created all of the
fields in your table.

Name and Save a Table


After you create a table, you must name and save it.

W. A. Kenyagah 21
To name and save a table:

1. Click the Save button on the Quick Access toolbar. The Save As dialog box appears.
2. Type the name you want to give your table.
3. Click OK. Access names your table.
Tip: You can use the Rename option at any time to rename any column. For example, you can
rename the ID column Employee ID.
Understanding Data Types
In Access, you use data types to specify the type of data each field can capture. A field with a data
type of text can store alphabetic characters and numbers. Generally speaking, you cannot perform
mathematical calculations by using a text field. For example, you can use a text field to store a street
address.
Unless you do some manipulation, you cannot use the numbers in the street address in mathematical
calculations. You will not be able to sum or average the numbers in an address field, which is fine,
because you probably do not want to. Alternatively, you can assign a Test Score field a data type of
Number. You can enter numbers into the field and then average, sum, or perform other calculations
with the numbers. However, you cannot enter an alphabetic character in a number field.
Data Types
Data Type Use Notes
Text Alphanumeric data. Use for text and for numbers that are not used .
in mathematical calculations. Use for names, addresses, and other
relatively short pieces of text. Can store up to 255 characters.
Memo Long text. Use for long pieces of text, such as notes and long
descriptions. Can store up to 64,000 characters.
Number Numeric data. Use for numbers you want to use in mathematical If you are working
calculations. with currency, use
the currency type.
Date/Time Use for dates and times.
Currency Use for currency. Prevents rounding
during calculation.
AutoNumber Unique sequential numbers or random numbers automatically
inserted when you create a record. Use to create a primary key.
Yes/No Logical data. Use when only one of two values is valid. Yes/No,
True/False, etc.
Hyperlink Use to store hyperlinks.
Attachment Use to store attachments.
OLE Object Use to attach an OLE object such as a Word document, Excel
spreadsheet, or PowerPoint presentation.

W. A. Kenyagah 22
After you create the fields for a table, you can enter data by typing in each field. As you type, Access
assigns a data type to each field based on your entry.

Assigned Data Types


Sample Entry Data Type Assigned
Smith Text
http://www.website.com Hyperlink
10000 Number, Long Integer
10,000 Number, Long Integer
10,000.99 Number, Double
10000.999 Number, Double
01/01/2009 Date/Time
The date and time formats recognized
are those of your user locale.
January 1, 2009 Date/Time
12:10:33 Date/Time
12:30 am Date/Time
16:50 Date/Time
100.50 Number, Double
25.00% Number, Double
1.23E+02 Number, Double

Explicitly Assign Data Types and Formats


You may want to change the data type Access assigned to a field, or you may want to explicitly assign
a data type to each field. You can do so by choosing the Datasheet tab and then selecting the proper
option in the Data Type field in the Data Type & Formatting group.

Some data types allow you to select the formatting you want. By formatting, you determine how data
in a field displays. For example, if you choose a data type of number and a format of Euro, any
number you enter will appear with a Euro sign in front.

Windows regional settings enable you to display information such as dates, times, and currency that
match the standards or language used in the country in which you live. For example, if you live in the
United States, the currency setting uses a dollar sign.

Regional Settings for English (United States)


Number 123,456,789.00
Currency $123,456,789.00
Time 3:39:44 PM
Short Date 7/28/2008
Long Date Monday, July 28, 2008

Use the Windows Control panel’s Regional and Language options to view or change regional settings.

W. A. Kenyagah 23
Data Types
Data Type Format How Numbers Display
Number General Number As typed.
Currency Uses thousands separator. Follows regional settings.
Euro Uses currency format with Euro symbol.
Fixed Displays at least one digit. Follows regional settings.
Standard Uses thousands separator. Follows regional setting.
Percent Converts entry to percent.
Scientific Uses scientific notation.
Currency General Number As typed.
Currency Uses thousands separator. Follows regional settings.
Euro Uses currency format with Euro symbol.
Fixed Displays at least one digit. Follows regional settings.
Standard Uses thousands separator. Follows regional setting.
Percent Converts entry to percent.
Scientific Uses scientific notation.
Date/Time General Date Date values display as numbers and time values as
hours, minutes, and seconds followed by AM or
PM. Follows regional settings.
Long Date Uses the Long Date format specified in your
Windows regional settings.
Medium Date Uses dd/mm/yy, using the date separator specified in
your Windows regional settings.
Short Date Uses the Short Date format specified in your
Windows regional settings.
Long Time Uses hours, minutes, and seconds followed by AM
or PM. Uses the separator specified in the Time
setting in your Windows regional settings.
Medium Time Displays hours and minutes followed by AM or PM.
Uses the separator specified in the Time setting in
your Windows regional settings.
Short Time Uses hours and minutes. Uses the separator
specified in the Time setting in your Windows
regional settings.
Yes/No Yes/No
True/False
On/Off

W. A. Kenyagah 24
To explicitly assign a data type or format to a field:

1. Click the field label for the field to which you want to assign a data type.
2. Activate the Datasheet tab.
3. Click the down-arrow next to the Data Type field and then choose a data type.
4. Click the down-arrow next to the Format field and then choose a format. Access assigns a
data type and format to the field you selected.
Tip: If you want every record in a field to be unique, check the unique box on the Datasheet tab in
the Data Type & Formatting group. If you do not want the user to leave a field blank, check the is
required box.
Tip: In the Data Type & Formatting group, there are several formatting options you can apply to

numbers. If you want to use the Currency format, click the Currency button ; if you want to

use the Percent format, click the Percent button ; if you want to use a Comma number format,

click the Comma button ; or if you want to increase or decrease the number of decimal place,

click the Increase Decimal or Decrease Decimal button .

Tip: You can create a new table at any time by activating the Create tab and then clicking Table.

Understanding Design View


Access provides several ways to view the objects in your database. You can use Design view to create
or modify an Access table. You can use the View button on the Home tab or the Table Design button
on the Create tab to change to Design view. Using Design view is the preferred method for creating a
table because it provides you with the most options and enables you to precisely define your table. In
addition to selecting a data type, you can set all of the following options in Design view.

W. A. Kenyagah 25
Design View Options
Field Property Data Type Comments
Field Size Text Enables you to restrict the number of characters stored in a text
field to 0 to 255 characters. The default is 255.
Number Enables you to select the type of number stored in a field.
Number Types Values Stored
Byte 0 to 255. (No fractions)
Decimal –9.999... x 1027 through +9.999... x 1027
Integer –32,768 to +32,767 (No fractions)
Long Integer –2,147,483,648 to +2,147,483,647
Single –3.4 x 1038 to +3.4 x 1038 numeric floating point values. Up to
seven significant digits.
Double –1.797 x 10308 to +1.797 x 10308 1038 numeric floating point
values. Up to fifteen significant digits.
Replication ID Globally Unique Identifier (GUID). Used by Access to establish
a unique identifier for replication.
Format Number Determines how numbers display. When you use the currency,
fixed, standard, and percent formats. Access follows the settings
specified in Regional Settings in the Windows Control Panel for
negative amounts, decimal and currency symbols, and decimal
places.
Currency Number General Number Displays as typed.
Currency Uses thousands separator. Follows regional setting.
Euro Uses currency format with Euro symbol.
Fixed Displays one digit. Follows regional settings.
Standard Uses thousands separator. Follows regional settings.
Percent Converts entry to percent.
Scientific Uses scientific notation.
Date/Time General Date Displays date and time.
Example: 01/02/99, 06:28:21 PM
Long Date Displays Day of Week and Date:
Example: Saturday, January 02, 1999
Medium Date Example: 02-Jan-99
Short Date Example: 01/02/99
Long Time Example: 6:28:21 PM
Medium Time Example: 6:28 PM
Short Time Example: 18:28
Text and Memo @ Text character required.
& Text character not required.
< Changes all characters to lowercase.

W. A. Kenyagah 26
> Changes all characters to uppercase.
Yes/No Yes/No If the Lookup Display Control is a text box, displays Yes/No.
True/False If the Lookup Display Control is a text box, displays True/False.
On/Off If the Lookup Display Control is a text box, displays On/Off.
Decimal Places Determines Auto. Number of decimals displayed depends on the format
number of setting.
decimal places
Access displays.
0–15. Used with format property. Determines the number of
digits that display to the right of the decimal point.
Input Mask Special
characters used
to control the
values the user
can input.
Caption Field name
displayed on
forms.
Default Value Sets the value
that appears in
the field by
default when a
record is created.
Validation Rule Sets the
requirements for
user input.
Validation Text Text for error
messages that are
sent when
validation rules
are broken.
Required Specifies whether Yes: Required
the field is No: Not Required
required or not.
Allow Zero Determines Yes: Is valid
Length whether a zero- No: Not valid
length field is a
valid entry.
Index Specifies whether Yes: Create index.
an index should No: Do not create index.
be created in a
field. Indexes
speed up queries.

W. A. Kenyagah 27
To use Design view to create a new table:

1. Activate the Create tab.


2. Click Table Design in the Tables group. Access changes to Design view and the Table Tools
become available.

3. Type the first field name in the Field Name field.


4. Press the Tab key.
5. Click the down-arrow that appears when you click in the Data Type field and then select a
data type.
6. Click Primary Key if the column you created is a primary key. A small key appears next to
the field name.
7. Press the Tab key.
8. Type a description. The description is optional.
9. Press the Tab key. Access moves to the Field Name field.
10. Repeat steps 3 through 10 until you have created all of your fields.

To set field properties:

W. A. Kenyagah 28
1. Click the field for which you want to set the field properties.
2. Activate the General tab in the Field Properties area.
3. Set the properties you want to set.
4. Repeat steps 1 through 3 until you have set all the properties for all fields.

You can use Design view to create or modify a table. After you finish the task, you must save the
table by clicking the Save button on the Quick Access toolbar.
1. Click the Save button on the Quick Access toolbar. Access saves the table unless you are
saving for the first time. If you are saving for the first time, the Save As dialog box appears.
2. Type the name you want to give your table.
3. Click OK. Access saves the table. You can now access the table by using the Navigation
pane.

What are views?


Views are different ways of looking at the same object. Tables have four views: Datasheet view, Pivot
Table view, Pivot Chart view, and Design view. You use Datasheet view to create a table, edit data, or
view data; Pivot Table view to create a pivot table; Pivot Chart view to create a pivot chart; and
Design view to create a table or modify an existing table.

To change the view:


1. Activate the Home tab.
2. Click the down-arrow under the View button. A menu appears.
3. Click the view you want. Access changes to the view you chose.

Tip: You can also use a template to create a table. Access has several templates from which you can
choose. When using a template, you create the table and then modify it to suit your needs.
1. Activate the Create tab.
2. Click the Table Templates button in the Tables group. A menu appears.
3. Click the template you want to use. Access creates a table based on the template.

Create a Lookup Column


If a field can contain a finite list of values, you can create a Lookup Column and users can select the
value they want from a list. For example, if the employees at a school can only work in one of the
following departments: Administration, Computer Science, English, History, or Math. You can create
a table Departments table that lists the departments and then use the list in the Employee table to
assign each employee to a department.

W. A. Kenyagah 29
Departments
Department ID Department
Primary Key
1 Administration
2 Computer Science
3 English
4 History
5 Math

Access has a wizard to help you create lookup columns. Creating a Lookup column creates a
relationship between two tables. See the section Create Relationships in Lesson 3 to learn more about
relationships.

To use the Lookup Wizard to create a lookup column:

Open the Lookup Wizard

1. Open the table to which you want to add a lookup column.


2. Click the field label for the field before which you want to add a lookup column.
3. Activate the Datasheet tab. (You must be in Datasheet view.)
4. Click the Lookup Column button in the Fields & Columns group. The Lookup Wizard
appears.
5. Make sure the radio button next to “I want the lookup column to look up the values in a table
or query.” is selected.
6. Click Next. The Lookup Wizard moves to the next page.

W. A. Kenyagah 30
Select your table or query
A lookup column can be based on a table, a query, or a list of values you type. If you base your
lookup column on a table or query, you must create the table or query before creating the lookup
column. A query is a list of rows and columns based on one or more tables. A query only displays the
rows and columns you specify.

1. Click a radio button to select what you want to base your lookup column on. Choose from
Tables, Queries, or Both.
2. Click to select the table or query you want.
3. Click Next. The Lookup Wizard moves to the next page.

Select fields
You choose the fields you want to appear in your lookup column. Be sure to include the primary key.

1. Click the field you want.


2. Click the single right-arrow button. Access places the field in the Selected Fields column.
Repeat this process to select additional fields. If you want all the fields in the table, click the
double right-arrow button. Note: Use the single left-arrow and the double left-arrows to
deselect fields.
3. Click Next. The Lookup Wizard moves to the next page.

W. A. Kenyagah 31
Sort fields
The Lookup Wizard allows you to sort the records in a lookup column. You can display records in
order, either ascending (alphabetical from A to Z, lowest number to highest number, earliest date to
latest date) or descending (alphabetical from Z to A, highest number to lowest number, latest date to
earliest date). You can also sort within a sort. For example, you can sort by state and then within each
state by city, and then within each city by street address. If you are creating a sort within a sort, create
the highest level sort on line one, the next level sort on line two, and so on. In the state, city, and street
address example, you create the state on line one, the city on line two, and the street address on line
three.

1. Click the down-arrow and then select the field you want to sort by.
2. Click to select a sort direction (the button toggles between ascending and descending). You
can sort within a sort for up to four levels.
3. Click Next. The Lookup Wizard moves to the next page.

Adjust column widths


A key column is the column that connects one table or query to another table or query. For example,
you can use the Department ID field in the Employees table and the Department ID field in the
Departments table to connect the two tables. You may, however, want to display the name of the
department when you view the table but not the department ID; if so, leave the Hide Key Column box
checked.

W. A. Kenyagah 32
1. Deselect Hide Key Column, if you wish.
2. Adjust the column widths by dragging or double-clicking the right vertical border for the
column.
3. Click Next. The Lookup Wizard moves to the next page.

Specify the Key Field (if you deselected Hide Key Column)
A key field is a field that uniquely identifies a record. If you deselected Hide Key column, you must
tell Access which field is the key field.

1. Click the key field.


2. Click Next. The Lookup Wizard moves to the next page.

Name the column


Field names appear at the top of each column. On this page of the Wizard you tell Access what you
want to name your lookup column. In Access 2007, multiple values can appear in a field; click the
Allow Multiple Values checkbox if you want to allow multiple values.

1. Type the name you want to give the column.


2. Click if you want to allow multiple values in the field.
3. Click Finish. Access creates the lookup column.

W. A. Kenyagah 33
How do I create a lookup column by typing a list?
1. Activate the Datasheet tab. (These instructions assume you are in the Datasheet view.)
2. Click the Lookup Column button in the Fields & Columns group. The Lookup Wizard
appears.
3. Click the radio button next to “I will type the values I want.”
4. Click Next. The Lookup Wizard moves to the next page.
5. Type the number of Columns you want in the Number of Columns field.
6. Type the values you want under the column heading.
7. Click Next. The Lookup Wizard moves to the next page.
8. Type the column label you want.
9. Click Finish. Access creates a lookup column based on your list.

Lesson 3: Working with Microsoft Access Tables


After you create an Access table, you can modify it, enter data into it manually or import data from
somewhere else, such as Excel. This lesson teaches you how to modify a table and enter data.

Enter Records
After you have created a table, you can enter data into it.

To enter data into an AutoNumber field:


 Press the Tab key. When you make an entry into another field in the record, Access will
automatically make an entry into the AutoNumber field.

To enter data into fields that have a lookup list:

1. Click the down-arrow that appears when you click in the field.
2. Click to select the entry you want.
3. Press the Tab key.

To enter data into a Yes/No field:

Click the checkbox for Yes; leave the checkbox unchecked for No.

To add an attachment to an attachment field:

W. A. Kenyagah 34
1. Double-click in the attachment field. The Attachments dialog box appears.
2. Click Add. The Choose File dialog box appears.

3. Click the file you want to add.


4. Click Open. The Choose File dialog box closes.

W. A. Kenyagah 35
5. Click OK. Access attaches the file.
Note: You can attach multiple files to a single attachment field.

To enter data into a date field:


 Type the date.
Or
 Select the date from the calendar that appears to the left of the field when you click in the
field. You click the calendar to open it. Use the left-arrow at the top of the calendar to move
to the previous month; use the right-arrow at the top of the calendar to move to the next
month. When you reach the proper month, click the proper date.

To add data to an OLE Object field:


An OLE object is an object such as a Word document or an Excel Spreadsheet.

W. A. Kenyagah 36
1. Right-click in the field. A menu appears.
2. Click Insert Object. The Microsoft Office Access dialog box appears.

Create New:

3. Click the Create New radio button if you want to create a new object.
a. Click the object type you want to create.
b. Click OK. Access opens the program for the object type you selected. You can create
the object.
c. Create the object and then close the program for the object type you selected. Access
links to the object.

Create From File:

3. Click the Create from File radio button if you want to use an existing file.
a. Type the path to the file or click the Browse button and locate the file.
b. Click OK. Access links to the object.
To add data to other field types:
For all other fields, type your entry and then press the Tab key.
Import a Table into Access from Excel
Excel organizes data into columns and rows. If you have data in Excel that you want to use in Access,
you can import those columns and rows into Access by using the Excel Spreadsheet Wizard.
To import data from Excel:
Open the Excel Spreadsheet Wizard

W. A. Kenyagah 37
1. Activate the External Data tab.
2. Click the Excel button in the Import group. The Get External Data – Excel Spreadsheet
Wizard appears.
3. Click the Browse button. The File Open window appears.
4. Locate the spreadsheet you want to import.
5. Click the Open button. The path to the file you selected appears in the File Name field.
6. Click OK. Access moves to the next page.
Choose the sheet or named range you want to import
When importing from Excel, you can import an entire worksheet or a named range. To import a
worksheet, click the Show Worksheets radio button and then click the worksheet you want. To import
a named range, click the Show Named Ranges radio button and then click the named range you want.

W. A. Kenyagah 38
1. Click Show Worksheets to import a worksheet, or click Show Named Ranges to import a
named range.
2. Click the worksheet or named range you want to import.
3. Click Next. Access moves to the next page.

Make the first row your field names


When you create a worksheet in Excel, the first row can contain column headings. If this is the case,
click First Row Contains Column Headings, otherwise click Next.

1. Click First Row Contains Column Headings if the first row of your Excel spreadsheet contains
column headings.
2. Click Next. Access moves to the next page.

Set data types


Access attempts to assign the correct data type to each column. You can view the assignment made by
Access and then make changes. An Index speeds up Access’s ability to search a column. You can use
the Indexed field to assign an index. The Yes (Duplicates OK) option creates an index in which
duplicate values in the field are allowed; the Yes (No Duplicates) option creates an index in which
duplicate values in the field are not allowed. The primary key should be indexed and you should use
the Yes (No Duplicates) option. You can also skip fields you do not want to import.

W. A. Kenyagah 39
1. Click a column heading to select a column.
a. Type the Access table’s column heading in the Field Name field.
b. Choose a Data type.
c. Indicate if the field should be indexed and, if so, select the type of index.
d. Check the Do Not Import Field box for any column you do not want to import.
2. Click Next. Access moves to the next page.

Choose a primary key

You can let Access assign the primary key, choose the primary key yourself, or have no primary key
by selecting the correct option on this page.

W. A. Kenyagah 40
1. Click to choose the proper radio button. If you want Access to add the primary key, click Let
Access Add Primary key. If you want to add the primary key, click Choose My Own Primary
Key and then click the down-arrow and select the field you want to use as the key field. If you
do not want to add a primary key, click No Primary Key.
2. Click Next. Access moves to the next page.

Name your table

1. Type the name you want to give your table.


2. Click Finish. Access moves to the next page.
3. Click Close. Access imports the table.

Modify a Table
After you create a table, you may need to modify it. You can delete columns, insert columns, or move
columns.

Delete Columns
The Delete option permanently deletes columns and all the data contained in them. You cannot undo a
column delete.

To delete columns:

W. A. Kenyagah 41
1. Click and drag to select the columns you want to delete.
2. Activate the Datasheet tab.
3. Click Delete in the Fields & Columns group. A prompt appears.
4. Click Yes. Access deletes the columns you selected.

Insert Columns
The Insert option inserts a column before the selected column.

To insert a column:

1. Click the column head of the column before which you want to insert a column.
2. Activate the Datasheet tab.
3. Click Insert in the Fields & Columns group. Access inserts a new column.

Tip: If you right-click a column label, you can use the menu that appears to insert or delete columns.

To delete a column:
1. Right-click the column head you want to delete. A menu appears.
2. Click Delete Column.

To insert a column:
1. Right-click the column head before which you want to insert a column. A menu appears.
2. Click Insert Column.

Move a Column
You can use the Move option to move a column from one location to another.

To move a column:
1. Move your mouse pointer over the horizontal line under the column label. Your mouse
pointer turns into a four sided arrow.

W. A. Kenyagah 42
2. Press your left mouse button
3. Click and drag the field to the new location. A dark line appears at the new location.
4. Release you left mouse button. Access moves the column.

Move around a Table


Access provides several methods for moving around a table. On the Home tab, there is a Go To
button. When you click it, a menu of options appears. You can use the menu to go to the first, last,
previous, or next record in your table. You can click the New option to add a new record. You can
also use special keys and the navigation bar in Access to move around a table. The navigation bar
appears at the bottom of the table.

To use the Go To button to move around a table:

1. Activate the Home tab.


2. Click the Go To button in the Find group. A menu appears.
3. Click First to go to the first record, Previous to go to the previous record, Next to go to the next
record, Last to go to the last record, or New to create a new record.
Tip: You can also create a new record by choosing the Home tab and then clicking New in the
Records group.

To use keys to move around a table:


Key to Press Action
Tab Moves to the next field to the right. If you are in the last field in a
record, moves you to the next record. If you are in the last record in
a table, creates a new record.
Left-Arrow Moves to the next field to the left. If you are in the first field in a
record, moves you to the previous record.
Shift+Tab Moves to the previous field. If you are in the first field in a record,
moves you to the previous record.
Right-Arrow Moves to the next field. If you are in the last field in a record,
moves you to the next record. If you are in the last record in a
table, creates a new record.
Up-Arrow Moves you up one record.
Down-Arrow Moves you down one record.
Ctrl++ Creates a new record.

W. A. Kenyagah 43
To use the Navigation bar to move around a table:

1 Go to First Record
2 Go to Previous Record
3 The Current Record
4 Go to Next Record
5 Go to Last Record
6 Create a New (Blank) Record

Select Columns and Rows


Before you can perform an operation on a column or row, you must select it. To select a column, click
the column head. To select several columns, click a column head and then drag. To select a row, click
the blank area to the left of the row. To select several rows, click the blank area to the left of a row

and then drag. To select the entire table, click the Select All button in the upper-left corner of
the table.

W. A. Kenyagah 44
Delete a Record
If enter a record by error, you can delete it.

To delete a record:
1. Select the record you want to delete.
2. Activate the Home tab.
3. Click Delete in the Records group. A prompt appears.
4. Click the Yes button.
Or
1. Select the record you want to delete.
2. Right-click. A menu appears.
3. Click Delete Record. A prompt appears.
4. Click the Yes button.

Resize a Column or Row


If all of the information in a column or row does not display, you may want to make the column or
row larger. If you want to fit more information on the screen, you may want to make a column or row
smaller. In either case, you can click and drag to increase or decrease column width or row height.

To resize a column or row:


1. Place the cursor over the line that separates two columns or two rows. The cursor turns into a
double-sided arrow.
2. Hold down the left mouse button and drag to increase or decrease the width of a column or
the height of all of the rows.

Lesson 4: Sorting, Filtering, and Creating Relationships


You can sort Access data so you can view records in the order you want to view them, and you can
filter data so you only see the records you want to see. This lesson teaches you how to sort and filter
an Access table.

W. A. Kenyagah 45
Access data is stored in multiple tables. Relationships join tables together so you can work with the
data from multiple tables. This lesson also teaches you how to create relationships.

Sort a Table
By sorting, you can put a column of information in alphabetical, numerical, or date order. You can
sort in ascending order (alphabetical from A to Z, lowest number to highest number, earliest date to
latest date) or descending order (alphabetical from Z to A, highest number to lowest number, latest
date to earliest date).
You can also sort within a sort. For example, you can sort by state and then sort within each state by
city. When sorting within a sort, perform the innermost sort first. For example, if you are sorting by
state and then city, sort the city first and then sort by state.

To add a sort:

1. Click the column label for the column you want to sort.
2. Activate the Home tab.

3. Click the Ascending or Descending button in the Sort & Filter group. Access
sorts the column in ascending or descending order.

To remove a sort:
1. Activate the Home tab.

2. Click the Clear All Sorts button in the Sort & Filter group. Access clears all of the
sorts you have applied.

Filter a Table
You can apply a filter to see only the records you want to see. For example, perhaps your database
contains students from the states of DE, NJ, and PA and you only want to see the students from DE.
You can filter your data so only DE students display.
Each time you apply a filter to a column, it replaces any previous filter you applied to that column.
For example, if you apply a filter so you only see students in DE, and later you apply a filter so you
only see students in NJ, Access clears the DE filter and then applies the NJ filter.
You can apply filters to multiple columns in the same table. For example, by applying a filter first to
the State field and then to the Last Name field, you can see all of the students in the state of DE whose
last names are Adams.

W. A. Kenyagah 46
To apply a filter:

1. Click the column label for the column you want to filter.
2. Activate the Home tab.
3. Click the Filter button. A menu appears.
4. Uncheck the items you do not want to appear, making sure only the items you want are
checked.
5. Click OK. Access filters your data and displays the word Filtered at the bottom of the
window.

W. A. Kenyagah 47
To remove a filter:
1. Activate the Home tab.
2. Click Advanced in the Sort & Filter group. A menu appears.
3. Click Clear All Filters. Access clears all the filters you have applied.

Tip: After you apply a filter, you can use the Toggle Filter button to toggle the application of the
filter on and off.

Apply a Specialized Filter


In addition to simply searching for a specific value, you can apply several specialized filters. For
example, you can find all of the records that do not equal the value you specify or you can find all of
the records that fall between two dates. The following are lists of specialized filters.

Text Filters
Equals Finds every record in the table where the field’s value equals the value you
enter.
Does Not Equal Finds every record in the table where the field’s value does not equal the
value you enter.
Begins With Finds every record in the table where the field’s value begins with the value
you enter.
Does Not Begin With Finds every record in the table where the field’s value does not begin with
the value you enter.
Contains Finds every record in the table where the field’s value contains the value
you enter.
Does Not Contain Finds every record in the table where the field’s value does not contain the
value you enter.
Ends With Finds every record in the table where the field’s value ends with the value
you enter.
Does Not End With Finds every record in the table where the field’s value does not end with the
value you enter.

Number Filters
Equals Finds every record in the table where the field’s value equals the value you enter.
Does Not Equal Finds every record in the table where the field’s value does not equal the value you
enter.
Less Than Finds every record in the table where the field’s value is less than the value you
enter.
Greater Than Finds every record in the table where the field’s value is greater than the value you
enter.
Between Finds every record in the table where the field’s value is between the values you
enter.

W. A. Kenyagah 48
Date Filters
Equals Finds every record in the table where the field’s value equals the date you enter.
Does Not Equal Finds every record in the table where the field’s value does not equal the date
you enter.
Before Finds every record in the table where the field’s value is before the date you
enter.
Greater Than Finds every record in the table where the field’s value is greater than (comes
after) the date you enter.
Between Finds every record in the table where the field’s date is between the dates you
enter.
All Dates in a Period Finds every record in the table where the field’s date is in the period you enter.

To apply a specialized filter:

1. Click the Last Name column label.


2. Activate the Home tab.
3. Click the Filter button. A menu appears.
4. Click the Text Filters option. A menu appears.
5. Click the option you want. A Custom Filter dialog box appears.

W. A. Kenyagah 49
6. Enter the appropriate information.
7. Click OK. Access filters your data and displays the word Filtered at the bottom of the
window.

Hide Columns
There may be times when you may not want to display a certain column or set of columns. In such
cases, you can temporarily hide the column or columns from view. Later, if you want to display them
column again, you can unhide them.

To hide columns:

1. Select the columns you want to hide.


2. Activate the Home tab.
3. Click the More button in the Records group. A menu appears.
4. Click Hide Columns. Access hides the columns you selected.

W. A. Kenyagah 50
In the figure, the Birth Date, Street Address, City, State, and Zip fields are hidden.
Or
1. Select the columns you want to hide.
2. Right-click. A menu appears.
3. Click Hide Columns.

To unhide columns:
1. Activate the Home tab.
2. Click the More button in the Records group. A menu appears.
3. Click Unhide Columns. The Unique Columns dialog box appears.
4. Select the column you want to display.
5. Click Close. Access displays the columns you chose.
Or
1. Right-click any column label. A menu appears.
2. Click Unhide columns.
3. Select the columns you want to display.
4. Click the Close button. Access displays the columns you selected.

Freeze Columns
If your table has a large number of columns, you may want to freeze columns so the frozen columns
stay in view as you scroll across the page. For example, if you have a Students table and you want the
Student Number, First Name, and Last Name to remain onscreen as you scroll across the table, you
can freeze the Student Number, First Name, and Last Name fields. When you freeze a column, Access
moves it to the far left side of your table. If you want it to remain there, you must save the table.

To freeze columns:

1. Select the columns you want to freeze.


2. Activate the Home tab.
3. Click the More button in the Records group. A menu appears.
4. Click Freeze. Access freezes the columns. As you scroll, the frozen columns remain
stationary.

To unfreeze columns:
1. Activate the Home tab.
2. Click the More button in the Records group. A menu appears.
3. Click Unfreeze. Access unfreezes the columns.

Format a Table
You can use the features in the Font group on the Home tab to apply a variety of formats to your
table.

W. A. Kenyagah 51
Format a Table
Button Function
Apply a font to all of the data in a table.

Apply a font size to all of the data in a table.

Bold all of the data in a table.

Italicize all of the data in a table.

Underline all of the data in a table.

Left-align a column.

Right-align a column.

Center a column.

Change the font color.

Change the background color. By default, the background color


is white.
Change the gridlines. Gridlines separate columns and rows.
This option allows you to display gridlines for columns only
(vertical), gridlines for rows only (horizontal), gridlines for
both columns and rows, or no gridlines at all.
Change the alternating color. For example, on a datasheet you
can have every other row appear in an alternating color.

To bold, italicize, or underline:


1. Place the cursor anywhere within the table.
2. Activate the Home tab.
3. Click the button for the format you want to apply. Access applies the format.

To left-align, right-align, or center:


1. Place the cursor anywhere within the column you want to left-align, right-align, or center.
2. Activate the Home tab.
3. Click the button for the format you want to apply. Access applies the format.

To change the font, font size, or gridlines:


1. Place the cursor anywhere within the table.
2. Activate the Home tab.
3. Click the down-arrow to the right of the option you want to apply. A menu appears.
4. Select the option you want. Access changes the font, font size, or gridlines.

To change the font color, background color, or alternating color:


1. Place the cursor anywhere within the table.
2. Activate the Home tab.
3. Click the down-arrow to the right of the option you want to apply. A menu of colors appears.
4. Select the color you want. Access changes the font color or the alternating color.

W. A. Kenyagah 52
Compute Totals
On the Home tab, you can use the Total button in the Records group to compute the sum, average,
count, minimum, maximum, standard deviation, or variance of a number field; the count, average,
maximum, or minimum of a date field; or the count of a text field.

To compute totals:

1. Open the table or query for which you want to compute totals.
2. Activate the Home tab.
3. Click the Totals button in the Records group. A Total line appears at the bottom of the table
or query.
4. Click on the Total line under the column you want to total. A down-arrow appears on the left
side of the field.
5. Click the down-arrow and then choose the function you want to perform. Access performs the
calculation and displays the results in the proper column on the Totals row.

Find and Replace


If you need to find a sequence of characters, a word, or a phrase in a table or field, you can use the
Find command. In Access, the Find command has three options: You can find all instances in a table
or field that match a sequence of characters, all instances that begin with a sequence of characters, or
all instances that contain a sequence of characters. For example, you can find all students with the last
name Smith, all students whose last name begins with S, or all instances of 08 anywhere in the field.
After you find the word, phrase, or sequence of characters you are searching for, you can replace it
with a new sequence of characters by executing the Replace command.

W. A. Kenyagah 53
To do a Find:

1. Place your cursor in the column you want to search.


2. Activate the Home tab.
3. Click the Find button in the Find group. The Find and Replace dialog box appears.

4. Activate the Find tab.


5. Type what you want to find in the Find What field.
6. Choose the name of the table you want to search in the Look In field if you want to search the
entire table or select the field you selected in step 1 if you want to search that field. If you want to
search another field, click in that field and then select it in the Look In field.
7. Choose Any Part Of Field if you want to search for your entry anywhere within a field, choose
Whole Field if you want the field to match the sequence of characters you entered, or choose Start
Of Field if you want the field to begin with a sequence of characters you entered.
8. Choose All in the Search field if you want to search the entire table, Up to search upward from
your current location, or Down to search downward from your current location.
9. Click Find Next to begin your search. Access finds the first entry that matches your find criteria.
Continue clicking Find Next to find additional matches.

Note: If you want to find and replace, open the Find and Replace dialog box (follow steps 1 through
3) and then activate the Replace tab. In the Replace With field, enter the sequence of characters you
want to use to replace what you find. Complete the other fields on the tab the same as you would if
you were doing a Find. Click Find Next to find the first instance for which you are searching. Click
Replace to replace that instance. Click Replace All to replace every instance.

Create Relationships
In Access, you store data in multiple tables and then use relationships to join the tables. After you
have created relationships, you can use data from all of the related tables in a query, form, or report.

A primary key is a field or combination of fields that uniquely identify each record in a table.

A foreign key is a value in one table that must match the primary key in another table. You use
primary keys and foreign keys to join tables together—in other words, you use primary keys and
foreign keys to create relationships.
There are two valid types of relationships: one-to-one and one-to-many. In a one-to-one relationship,
for every occurrence of a value in table A, there can only be one matching occurrence of that value in
table B, and for every occurrence of a value in table B, there can only be one matching occurrence of
that value in table A. One-to-one relationships are rare because if there is a one-to-one relationship,
the data is usually stored in a single table. However, a one-to-one relationship can occur when you
want to store the information in a separate table for security reasons, when tables have a large number
of fields, or for other reasons.

W. A. Kenyagah 54
In a one-to-many relationship, for every occurrence of a value in table a, there can be zero or more
matching occurrences in table B, and for every one occurrence in table B, there can only be one
matching occurrence in table A.
When tables have a one-to-many relationship, the table with the one value is called the primary table
and the table with the many values is called the related table.

Referential integrity ensures that the validity of the relationship between two tables remains intact. It
prohibits changes to the primary table that would invalidate an entry in the related table. For example,
a school has students. Each student can make several payments, but each payment can only be from
one student. The Students table is the primary table and the Payments table is the related table.

Students
Student ID Last Name First Name
Primary Key
1 John Smith
2 Mark Adams
3 Valerie Kilm
Payments
Payment ID Student ID Amount Due Amount Paid
Primary key Foreign key
1 1 500 500
2 2 700 300
3 3 500 250
4 2 400 300
5 3 250 250

If you delete Student ID 1 from the Students table, Student ID 1 is no longer valid in the Payments
table. Referential integrity prevents you from deleting Student ID 1 from the Students table. Also, if
the only valid Student IDs are 1, 2, and 3, referential integrity prevents you from entering a value of 4
in the Student ID field in the Payments table. A foreign key without a primary key reference is called
an orphan. Referential integrity prevents you from creating orphans.

To create relationships:
1. Close all tables and forms. (Right-click on the tab of any Object. A menu appears. Click
Close All.)

2. Activate the Database Tools tab.


3. Click the Relationships button in the Show/Hide group. The Relationships window appears.

W. A. Kenyagah 55
4. If anything appears in the relationships window, click the Clear Layout button in the Tools
group. If you are prompted, click Yes.
5. Click the Show Table button in the Relationships group. The Show Table dialog box appears.

6. Activate the Tables tab if your relationships will be based on tables, activate the Queries tab if
your relationships will be based on queries, or activate the Both tab if your relationships will
be based on both.
7. Double-click each table or query you want to use to build a relationship. The tables appear in
the Relationships window.
8. Click the Close button to close the Show Table dialog box.

9. Drag the Primary table’s primary key over the related table’s foreign key. After you drag the
primary key to the related table’s box, the cursor changes to an arrow. Make sure the arrow
points to the foreign key. The Edit Relationships Dialog box appears.

W. A. Kenyagah 56
10. Click the Enforce Referential Integrity checkbox.
11. Click Create. Access creates a one-to-many relationship between the tables.

12. Click the Save button on the Quick Access toolbar to save the relationship.

Tip: When you create a relationship, you can view the related table as a Subdatasheet of the primary
table. Open the primary table and click the plus (+) in the far left column. The plus sign turns into a
minus (-) sign. If the Insert Subdatasheet dialog box opens, click the table you want to view as a
Subdatasheet and then click OK. Access displays the Subdatasheet each time you click the plus sign
in the far left column. Click the minus sign to hide the Subdatasheet.

Tip: After a relationship has been created between two tables, you must delete the relationship before
you can make modifications to the fields on which the relationship is based. To delete a relationship:
1. Click the line that connects the tables.
2. Press the Delete key.

Tip: When you create a lookup column, Access creates a relationship between the tables.

Lesson 5: Creating Microsoft Access Queries


You can use a query to view a subset of your data or to answer questions about your data. For
example, if you want to view a list of student names and email addresses, but you do not want to see
addresses and other data, you can create a query that displays the student’s first name, last name, and
email address only. Alternatively, if you want to know which students live in DE, you can restrict
your list to those students. This lesson teaches you how to create a query.

W. A. Kenyagah 57
Open Tables or Queries in Query Design View
A query can be based on tables or on other queries. To create a query, you open the tables or queries
on which you are going to base your query in Query Design view, and then use the options in Design
view to create your query. You then click the Run button to display the results. You can save queries
for later use.

To open tables or queries in Query Design view:

1. Activate the Create tab.


2. Click the Query Design button in the Other group. The Show Table dialog box appears.
3. Activate the Tables tab if you want to base your query on tables, activate the Queries tab if you
want base your query on queries or activate the Both tab if you want to base your query on both
tables and queries.
4. Click to choose the table or query on which you want to base your query.
5. Click Add. The table appears in the window.
a. Click to choose the next table or query on which you want to base your query.
b. Continue clicking tables or queries until you have all the tables and queries you plan to use.
6. Click Close. Access changes to Query Design view.

Display All Records and All Fields


In Query Design view, each table has an option that allows you to display all of the fields and all of
the records in a table. This option appears on the field line on the drop-down menu as the table name
followed by a period and an asterisk (tablename.*).

W. A. Kenyagah 58
To display all records and all fields:

1. Open a table or query in Query Design view.


2. Click the down-arrow in the first field on the Field row and then select the tablename.*
option. The table name appears on the table line.
3. Click the Run button. Access retrieves all of the fields and records for the table and displays
them in Datasheet view.

Change from Datasheet View to Query Design View


After you run a query, you can easily change back to Query Design view and make modifications to
your query or create a new query.

W. A. Kenyagah 59
To change to Query Design view:

1. Activate the Home tab.


2. Click the down-arrow below View in the Views group. A menu appears.
3. Click Design View. Access changes to Query Design view. You can modify your query.

Tip: You can also click the Design button in the lower-right corner of the Access window
to change to Design view.

Retrieve a Single Column


You can use an Access query to retrieve a single column of data. Instead of choosing the tablename.*
option on the Field line in Query Design view, choose the name of the field you want to retrieve.

W. A. Kenyagah 60
To retrieve a single column:

1. Open a table or query in Query Design view.


2. Choose the field name you want to display in the field line.
3. Click the Run button. Access retrieves the column you chose.

Retrieve Multiple Columns


You can use an Access query to retrieve multiple columns of data. On the Field line in Query Design
view, choose the field name of each field you want to retrieve in the order you want to retrieve them.

W. A. Kenyagah 61
To retrieve multiple columns:

1. Open a table or query in Query Design view.


2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Click the Run button. Access retrieves the columns you chose.

W. A. Kenyagah 62
Sort a Query
When creating a query, you can sort the rows you retrieve in ascending or descending order by
choosing the option you want on the Sort row in Query Design view.

To perform a sort:

1. Open a table or query in Query Design view.


2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Under the field you want to sort, click the down-arrow and then choose Ascending or
Descending.
4. Click the Run button. Access retrieves the columns you chose and displays the rows in the
order you specified.

W. A. Kenyagah 63
Sort Multiple Columns in a Query
As you learned in the previous section, you can sort the rows your query returns. You can also create
sorts within a sort. For example, you can sort by state and then within a state, you can sort by last
name and then by first name.

You specify the sort in the order you want the sort to occur. If you want to sort by state and then by
last name within a state and then by first name within last name, you enter the sort in the following
order: city, last name, first name. Your sort order may not agree with the order in which you want to
display fields. In such a case, you can use fields that do not display to enter your sort order. To
prevent a field from displaying, deselect the Show box on the Show row.

W. A. Kenyagah 64
To sort multiple columns:

1. Open a table or query in Query Design view.


2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Choose the field names you want to sort by in the order you want to sort.
4. Under the fields you want to sort by, choose Ascending or Descending.
5. Deselect the Show button for the columns you do not want to display.
6. Click the Run button. Access retrieves the columns you chose and displays the rows in the
order you specified.

W. A. Kenyagah 65
Retrieve Specific Records
In the examples so far, you have been retrieving all of the records (rows) in your table. You can,
however, specify which records you wish to retrieve. For example, you can retrieve only those
students who live in DE, only the student whose student number is 5, or only those students whose
birth date is 2/16/88.
You use logical operators such as = (equal), <> (not equal), > (greater than), or < (less than) to restrict
the records you retrieve. For example, if you only want to display students who live in DE, enter =
"DE" in the State column on the Criteria line. Access will only retrieve records where the value in the
State column is equal to DE. Selection criteria are not case-sensitive, so Access will retrieve records
where the entry is DE, de, De, or dE.

Logical Operators
Operator Meaning Field Type Entry Format
= Equal to Character = "DE"
Number =5
Date = #2/16/88#
<> Not equal to Character <> "DE"
Number <> 5
Date <> #2/16/88#
> Greater than Character > "DE"
Number >5
Date > #2/16/88#
>= Greater than or equal to Character > = "DE"
Number >=5
Date > = #2/16/88#
< Less than Character < "DE"
Number <5
Date < #2/16/88#

W. A. Kenyagah 66
<= Less than or equal to Character <= "DE"
Number <= 5
Date <= #2/16/88#
In Equal to any item in a list Character In ("DE", "NJ")
Number In (5, 9, 17)
Date In (#2/16/88#, #2/3/90#,
#12/15/88#)
Not In Not equal to any item in a Character Not In ("DE", "NJ")
list Number Not In (5, 9, 17)
Date Not In (#2/16/88#, #2/3/90#,
#12/15/88#)
Between Between two values, Character Between "C" And "F"
greater than or equal to Number Between 5 And 10
one and less than or equal Date Between #1/1/88# And #12/31/88#
to the other
Not Between Not between two values Character Not Between "C" And "F"
Number Not Between 5 And 10
Date Not Between #1/1/88# And
#12/31/88#
Is Null The value is missing from Character Is Null
the field Number Is Null
Date Is Null
Is Not Null The value is not missing Character Is Not Null
from the field Number Is Not Null
Date Is Not Null
Like Like a specified pattern. Character Like "S*"
* means any series of Number Like "1*"
characters. Date Not Applicable
? means any single
character.
Not Like Not like a specified Character Like "S*"
pattern. Number Like "1*"
* means any series of Date Not Applicable
characters.
? means many single
character.

When using the Like and Not Like criteria, where you place the asterisk (*) or question mark (?)
determines the type of search Access performs. Like "Jo*" finds all records in the field that begin
with Jo. It would find Jones, Johnson, and Jordan. Like "*son" finds all records in the field that end
with son. It would find Stevenson, Jackson, and Peterson. Like "*456*" finds all records that contain
456 anywhere in the field. It would find 456123789, 123456789, and 123789456. The sequence Like
"? en" finds all three character field entries where the second and third characters are en. It would
find Ben, Len, and Jen. The sequence Like "Jo?" finds all three character field entries where the first
and second characters are Jo. It would return Joe, Joy, and Jon. The sequence Like "T?m" finds all
three character field entries where the first and third characters are T and m. It would return Tim,
Tom, and Tam.

W. A. Kenyagah 67
To retrieve specific records:

1. Open a table or query in Query Design view.


2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Choose the field names you want to sort by in the order you want to sort.
4. Under the fields you want to sort by, choose Ascending or Descending.
5. Deselect the Show button for columns you do not want to display.
6. Enter your selection criteria on the Criteria line.
7. Click the Run button. Access retrieves the columns you chose and displays the rows in the
order you specified.

Apply Multiple Criteria


You can apply multiple criteria to the same table. If you place two criteria on the same line, Access
will only retrieve records where both criteria are met. For example, if you want all records where the
State is equal to "DE" and the Last Name is equal to Smith, you would set the State field to = "DE"
and the Last Name field to = "Smith" and you would place both criteria on the same line.

W. A. Kenyagah 68
If you place one set of criteria on the Criteria line and the second set of criteria on the Or line, Access
will retrieve records if either criteria are met. For example, you want all records where the State is
equal to "DE" or the Last Name is equal to Smith. You would set the State field to = "DE" and the
Last Name field to = "Smith" and you would place one set of criteria on the Criteria line and the other
set of criteria on the Or line.
Access will bring back all records where the state equals DE and all records where the Last Name is
equal to Smith no matter what the State is. You can add additional andandor statements by using the
lines below the Or line. For And clauses, place the criteria on the same line; for Or clauses, place the
criteria on separate lines.

To apply multiple criteria:

1. Open a table or query in Query Design view.


2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Choose the field names you want to sort by in the order you want to sort.
4. Under the fields you want to sort by, choose Ascending or Descending.
5. Enter your selection criteria on the Criteria line and the Or line, as needed.
6. Deselect the Show button for columns you do not want to display.
7. Click the Run button. Access retrieves the columns you chose and displays the rows in the
order you specified.

W. A. Kenyagah 69
Create a Query That Uses Two or More Tables
If you want to view data from two or more tables or queries, you can create a query that pulls the data
from multiple tables or queries. The tables and queries from which you pull your data should have a
relationship.

To create a query that uses two or more tables:

1. Open the tables and/or queries you want to use in Query Design view.
2. Choose the field names you want to retrieve in the order you want to retrieve them.
3. Choose the field names you want to sort by in the order you want to sort. Under the fields you
want to sort by, choose Ascending or Descending.
4. Enter your selection criteria, if necessary (Not applicable in this example).
5. Deselect the Show button for columns you do not want to display (Not applicable in this
example).
6. Click the Run button. Access retrieves the columns you chose and displays the rows in the
order you specified.

W. A. Kenyagah 70
Save a Query
After you create a query, you can save it. You can rerun a saved query at any time. If you change the
data on which the saved query is based, you will see the changes when you rerun the query.

To save a query:

1. Click the Save button on the Quick Access toolbar. Access saves the query unless you are
saving for the first time. If you are saving for the first time, the Save As dialog box appears.
2. Type the name you want to give your query.
3. Click OK. Access saves the query. You can now access the query by using the Navigation
pane.

Tip: You can also save by right-clicking a query’s tab and then selecting Save from the menu that
appears. Access saves the query unless you are saving for the first time. If you are saving for the first
time, the Save As dialog box appears. Type the name you want to give the query and then click OK.
Access saves the query. You can now access the query by using the Navigation pane.

Tip: After you have saved a query, you can run it by opening the Navigation pane and then clicking
the name of the query.

Modify a Query
Once created, a query can be modified. Simply open the query in Query Design view and make the
changes. You can add columns, change the sort order, change the criteria, and make other changes.
In Query Design view, the Query Setup group offers several options that can assist you. Use the Insert
Rows button to insert a row in the criteria area. Click anywhere in the row before which you want to
insert a new row and then click the Insert Rows button.

Use the Insert Columns button to insert a column. Click anywhere in the column before
which you want to insert a column and then click the Insert Column button .

W. A. Kenyagah 71
Use the Delete Rows button to delete a row in the criteria area. Click anywhere in the row
you want to delete and then click the Delete Row button.

Use the Delete Columns button to delete a column. Click anywhere in the column you

want to delete and then click the Delete Column button .

Use a Query to Make a Table


You can use a query to create a table. This is useful when you want to create a new table that includes
the fields and data from an existing table.

To create a table:

1. Open the table or query on which you want to base your new table on in Query Design view.
2. Enter the criteria on which you want to base your new table.
3. Click the Make Table button. The Make Table dialog box appears.
4. Type the name you want to give your new table.
5. Click OK.
6. Click Run. You see the following prompt.

W. A. Kenyagah 72
7. Click Yes.
8. Close the query. (Right-click the query’s tab and then click Close.)
9. Double-click the new table’s name in the Navigation pane to view the new table.

Create a Parameter Query


If instead of entering predetermined criteria, you want to prompt users when a query runs, you can
create a parameter query. You create a parameter query by enclosing a question in square brackets
([]).

For example, if you want to create a parameter query that asks users which State they want to use
from the Student’s table, you would type [Which State?] on the Criteria line under the State column.
When the query runs, Access will prompt the user for the answer to your question.

To create a parameter query:

1. Open a table or query in Query Design view.


2. Create your query.
3. On the Criteria line, type the prompt within square brackets.
4. Click the Run button. Access prompts you.

5. Respond to the prompt.


6. Click OK. Access displays the results of your query in Datasheet view.

W. A. Kenyagah 73
Note: If you want to make your user prompt more flexible, use one of the following formats.

Returns all records that contain the value you enter.


Like "*" & [Prompt] & "*" Example: If you enter ad, Access returns all records that
include the sequence ad anywhere in the field.
Like "*" & [Prompt] Returns all records that end with the value you enter.
Example: If you enter S, Access returns all records that end
with S.
Like [Prompt] & "*" Returns all records that begin with the value you enter.
Example: If you enter S, Access returns all records that
begin with S.
> [Prompt] Find all records with a value greater than the value you
enter.
Example: If you enter 5, Access returns all records that are
Note: You can also use < (less greater than 5.
than) ,<= (less than or equal to) >=,
>= (greater than or equal to), or <>
(not equal)

Lesson 6: Creating Forms


Access forms are much like paper forms: you can use them to enter, edit, or display data. They are
based on tables. When using a form, you can choose the format, the arrangement, and which fields
you want to display. This lesson teaches you how to create forms.

Using the Form Button


Access can automatically create several types of forms.

For example, when you click the Form button on the Create tab, Access places all fields in the
selected table on a form. If the table has a one-to-many relationship with one other table or query,
Access creates a stacked form (the records are displayed in a column) for the primary table and a
datasheet for the related table. If there are several tables with a one-to-many relationship, Access does
not create the datasheet.

W. A. Kenyagah 74
To create a form:

1. Open the Navigation pane.


2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Form in the Forms group. Access creates a form.

You can use the Navigation bars to move through the records on a form.

W. A. Kenyagah 75
1 Go to First Record
2 Go to Previous Record
3 The Current Record
4 Go to Next Record
5 Go to Last Record
6 Create a New (Blank) Record

Tip: After you create a form, you can save it. You can open a saved form at any time.
To save a form:
1. Click the Save button on the Quick Access toolbar. Access saves the form unless you are
saving for the first time. If you are saving for the first time, the Save As dialog box appears.
2. Type the name you want to give the form.
3. Click OK. Access saves the form. You can now access the form by using the Navigation
pane.

You can also save by right-clicking a form’s tab and then selecting Save from the menu that appears.
Access saves the form unless you are saving for the first time. If you are saving for the first time, the
Save As dialog box appears. Type the name you want to give the form and then click OK. Access
saves the form. You can now access the form by using the Navigation pane.

Create a Split Form


A split form is a form in which the same data is displayed in two views simultaneously. One part of
the form displays in Form view (stacked fields), while the other part displays in Datasheet view. The
two views are synchronized, so as you select a field in one view, it is automatically selected in the
other view. You can add, change, or delete the data in either view. Using a split form gives you the
benefits of two types of forms in a single form. For example, you can use the datasheet portion to
locate records and the form portion to edit records.

W. A. Kenyagah 76
To create a split form:

1. Open the Navigation pane.


2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Split Form in the Forms group. Access creates a split form.

W. A. Kenyagah 77
Create a Multiple Items Form
You can use the Multiple Items button on the Forms tab to create a form that displays multiple
records, one record per row.

To create a multiple items form:

1. Open the Navigation pane.


2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Multiple Items in the Forms group. Access creates a multiple items form.

W. A. Kenyagah 78
Tip: A view is a way of looking at an Access object. Forms have three views: Form view, Layout
view, and Design view. You can enter, edit, and view data in Form view. You can modify a form in
Layout view or Design view. In Layout view, you can see your data, and the form you see closely
resembles what your form will look like when you view it in Form view. You can make most, but not
all, changes to your form in Layout view. Design view displays the structure of your form. In this
view you cannot see the underlying data, but you can perform some tasks in Design view that you
cannot perform in Layout view. This tutorial focuses on Layout view.

To change the view:


1. Open the form.
2. Activate the Format tab.
3. Click the down-arrow under the View button. A menu appears.
4. Click the view you want.

Modify a Form
After you create a form, it opens in Layout view, where you can modify it.

To change the size of a field:


1. Click a side of the field and drag to change the width of the field.
2. Click the top or bottom of a field and drag to change the height of a field.

To move a datasheet:
1. Click the datasheet to select it.
2. Click and drag the four-sided arrow in the upper-right corner to move the datasheet.

To resize a datasheet:
1. Click the datasheet to select it.
2. Click a side of the datasheet and drag to change the width.
3. Click the top or bottom of the datasheet and drag to change the height.

To apply an AutoFormat:
The AutoFormat option on the Format tab enables you to apply formats quickly, such as background
colors, field colors, field label colors, and fonts.
1. Activate the Format tab.
2. Click AutoFormat. The AutoFormat menu appears.
3. Click the format you want to apply.
To change a form title:
When you create a form, by default, Access uses the form name as the title. You can change the title.
1. Activate the Format tab.
2. Click the Title button.
3. Type the new title.

To add the date and time:


You can easily add the date and time to your form.
1. Activate the Format tab.
2. Click the Date and Time button. The Date and Time dialog box appears. Select the date and
time format you want. The date and time appear on your form.

Change Fonts and Formats


You can use options on the Format tab to manually apply individual formats to your report. However,
before you can apply a format to a field or field label, you must select it. To select a field or field
label, click it. To select multiple items, hold down the Shift key and then click each item you want to
select. A box surrounds selected items.

W. A. Kenyagah 79
Change Fonts and Formats
Button Shortcut Key Function
Layout View—Format Tab, Font Group
Apply a font to the current selection.

Set the size of the font for the current


selection.
Ctrl-b Bold the current selection.

Ctrl-i Italicize the current selection.

Ctrl-u Underline the current selection.

Ctrl-l Left-align the selection.


Ctrl-r Right-align the selection.
Ctrl-e Center the selection.
Change the font color.
Change the background color.

Change the alternating color. For example,


you can have every other row on a
datasheet appear in an alternating color.
Layout View—Format Tab, Formatting Group
Apply a Number format.

Use a currency symbol.

Change to percent.

Use thousand separators.

Increase decimal places.

Decrease decimal places.

Layout View—Format Tab, Gridlines Group


Add gridlines.

Change the weight of gridlines.


Change the style of gridlines.
Change the color of gridlines.
Layout View—Format Tab, Controls Group
Add a logo.

W. A. Kenyagah 80
Add or change a title.

Add a date and time.

Set line thickness.


Set line style.
Set line color.

Lesson 7: Creating Reports


Reports organize and summarize data for viewing online or for printing. A detail report displays all of
the selected records. You can include summary data such as totals, counts, and percentages in a detail
report. A summary report does not list the selected records but instead summarizes the data and
presents totals, counts, percentages, or other summary data only. Access has several report generation
tools that you can use to create both detail and summary reports quickly. This lesson teaches you how
to create reports.

Use the Report Button


The Report button creates a simple report that lists the records in the selected table or query in a
columnar format.

To use the Report button:

1. Open the Navigation pane.


2. Click the table or query on which you want to base your report.
3. Activate the Create tab.
4. Click the Report button in the Reports group. Access creates your report and displays your
report in Layout view. You can modify the report.

W. A. Kenyagah 81
Tip: After you create a report, you can save it.
1. Click the Save button on the Quick Access toolbar. Access saves the report unless you are saving
for the first time. If you are saving for the first time, the Save As dialog box appears.
2. Type the name you want to give your report.
3. Click OK. Access saves the report. You can now access the report by using the Navigation pane.
As with other objects, you can also save a report by right-clicking the reports tab and selecting Save.
Saved reports appear in the Navigation pane.

Tip: Reports created by using the Report button are plain and simple. The Modify a Report section of
this lesson teaches you how to customize a report to meet your needs.

Tip: Access reports created simply by using the Report button have several sections. They are
detailed in the following table.
Sections of a Report
Report Header Appears at the top of the first page and displays the
report title.
Page Header Appears at the top of every page and displays the
headings (field labels) for each column.
Page Footer Appears at the bottom of every page and displays
the page number and total number of pages.
Detail Section Appears between the page header and page footer
and displays the records from the table or query.
Report Footer This section is optional. Appears on the last page of
the report and displays summary information such
as grand totals.

W. A. Kenyagah 82
Use the Report Wizard
You can also use the Report Wizard to create a report. The Report Wizard provides you with more
flexibility than you get by using the Report button. You can choose the tables and fields, group the
data, sort the data, summarize the data, choose a layout and orientation, apply a style, and title your
report. Follow the steps shown here to create a report by using the Report Wizard:

To create a report by using the Report Wizard:


Open the Report Wizard

1. Activate the Create tab.


2. Click Report Wizard in the Reports group. The Report Wizard appears.

Select tables, queries and fields


When using the Report Wizard, you can use fields from multiple tables and/or queries if the
tables/queries have a relationship.

W. A. Kenyagah 83
1. Click the down-arrow next to the Table/Queries field and then click the table from which you
want to select fields.
2. Click a field and then click the single-right arrow to select a single field, click the double-right
arrows to select all fields, click a field and then click the single-left arrow to deselect a single
field, or click the double-left arrow to deselect all fields.
3. Repeat steps 1 and 2 for each table from which you want to select fields.
4. Click Next. The Report Wizard moves to the next page.

Group
When using the Report Wizard, you can group data. Grouping puts all of the values in a field into a
group based on the field’s value. For example, if your data is grouped by the Department field and the
records in the Department field have values such as Administration, Computer Science, and English.
Access will group all of the data for the Administration department together, all of the data for the
Computer Science department together, and all of the data for the English department together.

W. A. Kenyagah 84
1. Click to select the field by which you want to group your data. You may not see this page of
the wizard if you are selecting data from a single table.
2. Click Next. The Report Wizard moves to the next page.

3. Click a field you want to group by.


4. Click the right-arrow to select a field; click a field and then click the left arrow to deselect a
field. Use the up- and down-arrows to change the order of the groupings. If you are only using
one table, this may be your first opportunity to select a field to group by.
5. Repeat steps 3 and 4 for each field you want to group by.
6. Click Next. The Report Wizard moves to the next page.

W. A. Kenyagah 85
Sort and summarize
By using the Report Wizard, you can create up to four levels of sort. Access sorts the first level, and
then sorts the second level within that sort, and so on. If you have grouped your data, you can
summarize it by displaying the sum, average, and minimum or maximum value for each numeric
field. You can choose to have your report display just the summary data or each detail line and the
summary data. There is also an option that allows you to display the percent the sum of each group is
of the grand total. All of the fields in your report may not fit on a single page. You can have Access
automatically adjust the size of the font so that every field fits.

1. Click the down-arrow and then select the field you want to sort by.
2. Click the button to choose ascending or descending order. Clicking the button toggles
between Ascending and Descending. You can sort up to four levels.
3. Click the Summary Options button. The Summary Options window appears.

W. A. Kenyagah 86
4. Click to select the summary data you want.
5. Click to select whether you want detail and summary data or if you want summary data only.
6. Click if you want to calculate the percent to the total for sums.
7. Click OK. The Summary Options window closes.
8. Click Next. The Report Wizard moves to the next page.

Layout and orientation


You can choose the layout and orientation of your report. The layout determines where each field
appears on the page. Access provides three options to choose from: Stepped, Block, and Outline.
When you choose an option, the left side of the window displays a graphic of the layout.

Orientation determines whether Access creates the report in portrait or landscape. Most paper, such as
paper sized 8 1/2 by 11, is longer on one edge than it is on the other. If you print in Portrait, the
shortest edge of the paper becomes the top of the page. Portrait is the default option. If you print
Landscape, the longest edge of the paper becomes the top of the page.

W. A. Kenyagah 87
1. Click to select a layout.
2. Click to select a page orientation.
3. Choose the Adjust The Field Width So All Fields Fit On A Page option if you want all fields to fit
on a single page.
4. Click Next. The Report Wizard moves to the next page.
Style
A style is a set of formats consisting of such things as background colors, fonts, font colors, and font
sizes. Access supplies predesigned styles that format titles, labels, and more. When you choose a
style, the left side of the window displays a preview.

W. A. Kenyagah 88
1. Click to select a style.
2. Click Next. The Report Wizard moves to the next page.

Create a title
On the final page of the Report Wizard, you can title your report. The title appears at the top of the
report and on the

Navigation pane.

1. Type the title you want to give the report.


2. Click Finish. Access creates, saves, and opens your report in Layout view.

W. A. Kenyagah 89
Tip: Reports created with the Report Wizard may have the following two sections in addition to the
sections found in reports created by using the Report button.

Sections of a Report
Group Header Appears before a group and displays information about the
group.
Group Footer Appears after a group and summarizes the group data.

Modify a Report
After you create a report, you can modify it. You can add groups or sorts, add fields, change labels,
and perform many other tasks.

You can view a report in Report view, Layout view, Design view, and Print Preview. You can modify
a report in Layout view or Design view. In Layout view, you can see your data, and the report you see
closely resembles how your report will look when you print it. You can make most, but not all,
changes to your report in Layout view. Design view displays the structure of your report. In this view
you cannot see the underlying data, but you can perform some tasks in Design view that you cannot
perform in Layout view. This tutorial focuses on Layout view.

To change to Layout view:


1. Open your report.
2. Activate the Home tab.
3. Click the View button. A menu appears.
4. Click Layout View. Access changes to Layout view.

Change the Size of a Field or Label


If the data in a field or label seems crowded, if some of the data in the field or label does not appear,
or if the data appears as pound signs (####), the field or label is too small.

W. A. Kenyagah 90
To change the size of a field or label:
1. Click the field or label. A border appears around it.
2. Click a side of the border and drag outward to increase the width. Click a side of the border
and drag inward to decrease the width.
Tip: Incidentally, if you want to change the height of records, click the top or bottom of a field border
and drag upward or downward.
Add a Group or Sort
When you create a report by clicking the Report button, you are not given options that enable you to
group or sort. You can use the Group & Sort button on the Format tab to create a group or sort. When
you create a report by using the Report Wizard, you can use the Group & Sort button to add or modify
a group or sort.
To Group or Sort:
Open the Group, Sort, and Total pane

1. Open your report in Layout view.


2. Activate the Format tab.
3. Click Group & Sort in the Grouping and Totals group. The Group, Sort, and Total pane
appears.

W. A. Kenyagah 91
Add a group

4. Click Add A Group and then select the field by which you want to group. Access groups and
sorts the field.
Add a sort

5. Click Add A Sort and then select the field on which you want to sort. Access sorts the field.
Groups and sorts display in the Group, Sort, and Total pane in levels. Access performs the highest-
level group or sort first, the second level next, and so on.

W. A. Kenyagah 92
After you have added a group or sort, you can set several options by clicking the More button and
then clicking the down-arrow next to each option and making your choices.

Group, Sort, and Total Pane Options


Option Description
Sort order Use these options to choose from ascending or descending order.
With A on top
From smallest to largest
From oldest to newest
Group interval Set how you want to group. For example, if you want to group by the first
letter of the last name so that all As are together, all Bs are together. etc., you
can select By First Character.
Totals Select the field you want to total on and the type of total you want. Your total
can be a sum, average, count, etc. You can also choose whether you want to
show a grand total, totals as a percentage of a grand total, display totals in the
header, or display totals in the footer.
Title Allows you to add or change the field label.
With or without a header Group headers precede each group. This option allows you to determine
section whether you want a header section.
With or without a footer Group footers are printed at the bottom of each group. This option allows you
section to determine whether you want a footer section.
Use these options to determine where a page break will occur when you print:
Do not keep group together on one page. This option allows page breaks
within a group.
Keep group together Keep whole group together on one page. This option prevents page breaks
within a group.
Keep header and first record together on one page. This option prevents a
header from printing at the bottom of a page with no records.

W. A. Kenyagah 93
There are three buttons on the right side of the Group, Sort, and Total pane. If you want to delete a
group or sort, click the group or sort you want to delete and then click the Delete button. Groups and
sorts execute in the order they are listed in the Group, Sort, and Total pane. If you want to change the
order of execution, click the group or sort you want to move up or down and then click the Move Up
or Move Down button to move a group or sort up or down a level.

To add a field:

1. Open your report in Layout view.


2. Activate the Format tab.
3. Click the Add Existing Fields button in the Controls group. The Field List pane appears.
4. Click Show All Tables if the field you want to add does not appear.

W. A. Kenyagah 94
5. Click the field you want to add and drag it onto your report. A thick line appears on the
report. Access places the field before the line. If you want the field to appear in the detail
area, be sure to drag it to the detail area.
To delete a field:
1. Open your report in Layout view.
2. Click the field you want to delete.
3. Press the Delete key. Access deletes the field.

To move a column:
1. Open your report in Layout view.
2. Click the column label.
3. Drag the column to the new location. Access moves the column to the new location.

To change a title:
1. Open your report in Layout view.
2. Double-click in the Title field.
3. Click and drag to select the current title.
4. Type a new title.
5. Click anywhere outside the Title field. Access changes the title.
To change a field label:
1. Open your report in Layout view.
2. Double-click the field label.
3. Click and drag to select the label name.
4. Type the new label name.
5. Click anywhere outside the label. Access changes the field label.
To change the paper size:
1. Open your report in Layout view.
2. Activate the Page Setup tab.
3. Click the Size button in the Page Layout group. A menu appears.
4. Click the size of the paper you are going to print on.
To change paper orientation:
1. Open your report in Layout view.
2. Activate the Page Setup tab.
3. Click Portrait or Landscape to choose the orientation you want to use. Access changes the
page orientation.
To change margins:
1. Open your report in Layout view.
2. Activate the Page Setup tab.
3. Click the Margins button in the Page Layout group. A menu appears.
4. Click the margin size you want. Access changes the page margin.
To add page numbers:
1. Open your report in Layout view.
2. Activate the Format tab.
3. Click the Insert Page Number button in the Controls group. The Page Numbers dialog box
appears.
4. Click a radio button to choose a format.
5. Click a radio button to choose a position.
6. Click the down-arrow in the Alignment field and then choose an alignment.
7. Deselect Show Number On First Page if you do not want the page number to appear on the
first page.
8. Click OK. Access places the page number in your report.

W. A. Kenyagah 95
To add current date or time:
1. Open your report in Layout view.
2. Activate the Format tab.

3. Click the Date and Time button in the Controls group. The Date and Time dialog
box appears.

4. Deselect the Include Date box if you do not wish to include the date.
5. Click to select a format if you are including the date.
6. Deselect the Include Time box if you do not wish to include the time.
7. Click to select a format if you are including the time.
8. Click OK. Access places the date and/or time in your report.

Apply an AutoFormat
You can use the AutoFormat option on the Format tab to apply formats such as background colors,
fonts, and font sizes quickly.

To apply an AutoFormat:
1. Activate the Format tab.
2. Click AutoFormat. The AutoFormat menu appears.
3. Click the format you want to apply.

Change Fonts and Formats


You can use options on the Format tab to manually apply formats to your report. However, before you
can apply a format to a field or field label, you must select the field or field label by clicking it. To
select multiple items, hold down the Shift key and then click each item you want to select. A box
surrounds selected items.

Change Fonts and Formats


Button Shortcut Function
Key
Layout View—Format Tab, Font Group
Apply a font to the current selection.

W. A. Kenyagah 96
Set the size of the font for the current
selection.
Ctrl-b Bold the current selection.

Ctrl-i Italicize the current selection.

Ctrl-u Underline the current selection.

Ctrl-l Left-align the selection.


Ctrl-r Right-align the selection.
Ctrl-e Center the selection.
Change the font color.
Change the background color.

Change the alternating color. For example,


you can have every other row in the detail
area appear in alternating colors.
Layout View—Format Tab, Formatting Group
Apply a Number format.

Use a currency symbol.

Change to percent.

Use thousand separators.

Increase decimal places.

Decrease decimal places.

Layout View—Format Tab, Gridlines Group


Add gridlines.

Change the weight of gridlines.


Change the style of gridlines.
Change the color of gridlines.
Layout View—Format Tab, Controls Group
Add a logo.

Add a title.

Set line thickness.

Set line style.


Set line color.

W. A. Kenyagah 97
Tip: After you modify your report, you must save it if you want to keep the changes. To save, click
the Save button on the Quick Access toolbar or right-click the report’s tab and then click Save.

Create Mailing Labels


In Access, the easiest way to create a mailing label is to use the Label Wizard. The Label Wizard
extracts name and address data from your database and formats it so you can print it on commercially
available labels.
Each time you view or print labels, the data are extracted from the database, so as you update your
database, Access updates your labels.

To create labels:
Open the Labels Wizard

1. Click the table or query you want to use to create a label.


2. Activate the Create tab.
3. Click Labels in the Reports group. The Labels Wizard appears.

Choose a product number


Most commercially available labels have a product number. You should be able to find the number on
the box. You use the product number to tell Access the dimensions of your labels and the number of
columns and rows that are on a page.

W. A. Kenyagah 98
1. Click to select the Product Number in the Product Number field.
2. Click Next. The Label Wizard moves to the next page.

Choose a font, font size, font weight, and color


A font is a set of characters (text) represented in a single typeface. Each character within a font is
created by using the same basic style. The Label Wizard has options that allow you to select a font,
font size, weight, and color. You can also choose to italicize or underline the text in your labels.

1. Click the down-arrow next to the Font Name field and then select the font. A preview appears
in the Sample box.
2. Click the down-arrow next to the Font Size field and then select the font size. A preview
appears in the Sample box.
3. Click the down-arrow next to the Font Weight field and then select the font weight. A
preview appears in the Sample box.
4. Click the button next to the Text Color field and then select a color you want your text to
have. A preview appears in the Sample box.
5. Click the Italic box if you want to italicize. A preview appears in the Sample box.
6. Click the Underline box if you want to underline. A preview appears in the Sample box.
7. Click Next. The Label Wizard moves to the next page.
Create a layout
You create the layout of your labels by selecting fields and placing them in the Prototype Label box.
You type any text or spaces that you want to appear on your label.

W. A. Kenyagah 99
1. Click a field name and then click the right-arrow to place the field on the prototype label.
2. Press the spacebar to leave spaces.
3. Press the Enter key to move to a new line.
4. Type any text you want to appear on the label.
5. Click Next. The Label Wizard moves to the next page.

Sort
When creating labels, you can sort on any field and you can have multiple levels of sort. For example,
you can sort by last name and then by first name.

1. Click to choose the fields you want to sort by. Click the single right-arrow to select a single
field, click the double right-arrow to select all fields, click the single left-arrow to deselect a
single field, click the double left-arrow to deselect all fields.
2. Click Next. The Label Wizard moves to the next page.

W. A. Kenyagah 100
Title the report

1. Type a title for your report. The title will appear in the Navigation pane.
2. Click Finish. Access displays the labels in Print Preview.

Tip: When you complete your labels you may get the following message.
When printing mailing labels, you can usually ignore this message. Click the Show Help button to
read the following:
This message may be the result of using a report created with the Label Wizard. This error message is
commonly encountered when printing to label pages that have three or more labels per row. Usually
this message can be ignored.

W. A. Kenyagah 101
If you do need to change the layout, try one or both of the following:
 Reduce the width of the controls on the report.
 Reduce the width of the report to make sure the report is not wider than the printable area of
the page.
Note that page size is dependent on the printer and the physical size of the paper you are printing to.
In some cases it is necessary to rotate the page orientation from portrait to landscape to accommodate
the selected print width.

Tip: When you view labels in Report view, they may appear in a single column. To see how your
labels will appear when printed, use Print Preview.

Print a Report
Often, the people who use Access data only see a printed report. In Print Preview, you can see exactly
how your report will look when printed, you can make changes to it, and you can print it. To print,
click the Print button in the Print group. The Print dialog box opens and you can select your print
options.

To change to Print Preview:


1. Open your report.
2. Activate the Home tab.
3. Click the down-arrow under the View button. A menu appears.
4. Click Print Preview. Access changes to Print Preview.

Several options are available to you in Print Preview.


Print Preview Options
Print Displays the Print dialog box. You can select such options as the printer,
print range, and number of copies. Use this option to print your report.
Size Click the Size button to set the size of the paper you are going to print on.
Portrait Click the Portrait button to print with the shortest side of the paper as the
top.
Landscape Click the Landscape button to print with the longest side of the paper as the
top.
Margins Click the Margins button to select a margin size of Normal, Wide, or
Narrow. Margins define the amount of white space that surrounds your
report.
Print Data Only Prints the report data without other elements such as titles, and labels.
Zoom Changes the cursor to a magnifying glass. When the magnifying glass
displays a minus sign (–), you can zoom out. When the magnifying glass
displays a plus sign (+), you can zoom in.
Click the down-arrow under the Zoom button to display a menu and choose
a zoom level.
One Page Displays one page of the report in the Access window.
Two Page Displays two pages of the report in the Access window.
More Pages Displays a menu from which you can choose the number of page you want
to display.

Tip: To view a report online, use Report view. Open your report. Activate the Home tab. Click the
down-arrow under the View button. Click Report view. Your report displays in Report view.

W. A. Kenyagah 102

You might also like