0% found this document useful (0 votes)
83 views6 pages

Access Tutorial 3 - Instructions File

This tutorial teaches how to create queries and reports in Microsoft Access. It introduces queries as a way to view and analyze data from different tables. Reports are used to present data in a printed format. The tutorial demonstrates how to create a query that joins three tables and includes calculated fields. It also shows how to create a second query that filters records and sorts data. Finally, it provides instructions for generating a basic report from an existing query using the report wizard.

Uploaded by

farina zhoriifah
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)
83 views6 pages

Access Tutorial 3 - Instructions File

This tutorial teaches how to create queries and reports in Microsoft Access. It introduces queries as a way to view and analyze data from different tables. Reports are used to present data in a printed format. The tutorial demonstrates how to create a query that joins three tables and includes calculated fields. It also shows how to create a second query that filters records and sorts data. Finally, it provides instructions for generating a basic report from an existing query using the report wizard.

Uploaded by

farina zhoriifah
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/ 6

Microsoft Access 2019 Tutorial #3

INFO 123 Hands-on Tutorials


Microsoft Access for Windows (Tutorial #3)

This tutorial uses the same ‘Winter’ database from Tutorial 2. Please ensure your database matches the
one from Learn before beginning this Tutorial (WinterTut2Complete). This tutorial introduces Queries
and Reports.

Learning Objectives:
• Understand what a query is and how to create one
• Sort records in a query
• Use the criteria option to create a query that selects particular records
• Create a basic report based on a query

Task 1 - Understanding Queries and Reports


Queries allow you to view and analyse data in different ways. For example, you could use a query to
bring together data from different tables, to sort data in a particular order or how to perform calculations.
Reports are an effective way to present your data in a visible, printed format. You have control over the
size and appearance of everything on a report, meaning you can display the information how you want
to see it. A Microsoft Access report uses information from a Table or Query.
Please ensure you understand how to create tables before continuing with this exercise. If you need help,
speak to your tutor. Once you are confident with table creation, please ensure that your Winter database
from Tutorials 1 & 2 is up to date. Please compare your version with the one provided on Learn.

1.1 - Designing an Access Query


Before you begin, please check you have correctly added relationships between your tables, as shown
in Tutorial 1 to match the image below. These relationships need to be correct because the query we are
creating will use data from all three tables (Customer, Sales Order & Product).
Using data from multiple tables requires you to join the tables together. A join needs relationships to
get the correct data. Our join will use the CustID and ProductNo fields.
➢ Select the Create Tab on the Ribbon. On the Queries group, select Query Design.
➢ In the Show Table windows, select each of your three tables and click Add. You should
see a new design tab appear called ‘Query 1’.

1
Microsoft Access 2019 Tutorial #3

We have successful used our query to join the three tables together. The second step is to identify the
specific details we wish to include in our query.
The first query we will create will detail the orders placed by each customer. It will include the following
fields:
• FirstName, LastName & CustID (From Customer table)
• OrderNo, Quantity & OrderDate (From Sales Order table)
• ProductNo, Description & Unit_Price (From Product table)

➢ Drag and drop each field from above and move from the Field List into the Design Grid.
Your Design Grid should match as shown below.

Field List

Design Grid

1.2 - Adding a Calculated Field


A calculated field is a new field which is calculated from other fields in your query. Below we will
create a calculated field called Order Total. This will be the total cost of an order.
➢ To add a new field, select the last column of the Field row. Call your new field OrderTotal.
When creating a calculated field, you must enter a calculation to be done. There is a specific syntax
required for this.
Please follow the instructions below to compute your field correctly.
➢ Change your field from OrderTotal to OrderTotal: [Quantity]*[Unit_Price]
You have now entered a calculation to compute the total cost of each order. The field can be broken
down into two main parts:
1) The Calculated Field Name: This is the OrderTotal part of your field. Changing this will
change the name of the calculated field.
2) The Calculation: This is the [Quantity] * [Unit_Price] part of your field.
a. The [ ] notation surrounds the name of other fields you wish to use in your
calculation.
b. The : separates the Calculated Field Name and the Calculation.
c. The * in the calculation above represents multiply. This could be replaced with:
i. + (addition)
ii. - (subtraction)
iii. / (division)
If you do not follow this syntax correctly, you will get a syntax error message. Please ask your tutor for
help if you need it.

2
Microsoft Access 2019 Tutorial #3

➢ Save the Query as Customer Orders.


➢ To view the output of your query, open your Customer Orders query in Datasheet View.
You can do this by opening it from the All Access Objects pane. You should see an
output similar to what is shown below. Note the computed OrderTotal.

1.3 - Sorting
You can quickly sort records in the Datasheet view of a Table, Query or Form.
➢ Select the drop-down arrow next to OrderTotal. Choose Sort Smallest to Largest. You will
see the order of the records change.
➢ Change the sort order to CustID smallest to largest.
While that is a simple method, you may want to set the sort order for a query by default, rather than
manually changing from the datasheet view.
➢ Navigate to the Customer Orders query in the All Access Objects pane, right click and
select Design.
➢ In the Design view, select the field that you wish to sort on and click in the Sort row. A down
arrow will appear. Click on the down arrow and select Ascending.
➢ Navigate to the Datasheet view of your Customer Orders query to view the sorted orders.
Go back to the Design view and sort the order to Descending.
Remember to Save your query.

Task 2 - Your Second Query

2.1 - Designing a New Query


In this part of the tutorial you will create a NEW query that reports only those orders that were for Skis.
Your new query will be based on your existing Customer Orders query.
➢ Navigate to the All Access Objects pane and right click your Customer Orders query and
select Copy from the menu.
➢ Right click the pane and select Paste. Name your new query Customer Special Orders.
➢ Open your new query in in Design view. You will now make a number of modifications to
meet the criteria for the query.
➢ Ensure that your records are sorted by LastName in descending order before continuing.
➢ Click the Criteria option below the Description field and enter ‘Skis’. Change back to
Datasheet view and you should see only orders for skis, sorted by LastName descending.
Finally, we will edit the query to show only the FirstName, LastName, Quantity, Order Total,
Description and OrderDate.

3
Microsoft Access 2019 Tutorial #3

➢ For each of the fields that are not required, remove the tick in the Show box. This is useful
when you want to sort or select on a criterion, but not show that data in your result.
Please check the images below if you have any issues.

Design View

Datasheet View
2.2 - Joining Two or More Fields
So far, we have been working with the customers’ name as two separate fields. Sometimes, it is more
useful to show this as one field (Customer Name), that is, we may want to join (concatenate) two or
more fields together.
In this task we will modify our Customer Orders query to include a new field called CustomerName
made up of FirstName and LastName.
➢ Open the Customer Orders query in Design view. As we did early, we will follow the
same process as we did when creating a calculated field.
➢ Click on the last column of the Field row to add a new field. This will be called
CustomerName. Joining two fields together requires a plus (+) sign.
➢ Enter CustomerName: [FirstName] + " " + [LastName]
The " " signifies an empty space. You could enter anything in here to show between first name and last
name such as a comma (,).
➢ Open the Customer Orders query in Datasheet view to see the changes you have made.
You will see FirstName, LastName and CustomerName showing.
➢ Modify the query to show only CustomerName (not FirstName or LastName).
➢ Be sure to save your query.

Extra Resources
➢ More details on managing data with queries can be found here.

4
Microsoft Access 2019 Tutorial #3

Task 3 - Creating a Basic Report


Reports are a fantastic way to easily display only the information you require. You are able to customise
the data which is shown and how it will be presented. We will be using the Access reports wizard to
create our first report.
➢ Click the Create tab in the ribbon. Under the Reports group, select Report Wizard.
➢ You can select which tables or queries to pull information from using the down arrow. For
our report, ensure Query: Customer Orders is selected.

➢ From the list of available fields, highlight each field that is required and move them to the
Select Fields list by clicking the > button. Ensure to select the fields listed below and click
Next.
• CustomerName
• OrderDate
• Quantity
• Description
• Unit_Price
• OrderTotal
You will now be asked if you wish to add a Grouping level to group the records. This allows you to
break the report into parts based on a particular field. We will break our report into each Customer.
➢ Select the CustomerName field and click the > button. Click Next.
The wizard will now prompt you to identify a Sort
order for the report. Sorting allows you to specify the
order in which report contents are to be listed.
Sorting will order the records within the group based
on the field you select.
➢ Select OrderDate from the drop-down
menu and click next. Ensure Ascending
is selected. Click Next.

5
Microsoft Access 2019 Tutorial #3

You will now be asked to choose your layout and orientation for your report. The layout option allows
you to specify how the data will be arranged on the page.
➢ Select Stepped layout and Portrait orientation to format our report. Be sure to check
Adjust the field width so all fields fit on a page. Click Next.
The final step is to name your report. To do this, you need to enter a Title.
➢ Choose an appropriate name such as Customer Orders. Ensure the Preview the report
option is checked and click Finish.
You may need to modify the layout of the report to show all information properly (Dates may show as
#######). We will do this next week.
Check over the page to ensure your report matches the one shown. Do not worry if the layout is incorrect,
just ensure that the correct information is being shown.

Extra Practise
1. The Accounts Payable Accountant has asked for a list of creditors. Run a query that shows
each customer’s name (in one field), their credit limit, balance and credit rating. The Accounts
Payable Accountant has asked to see all customers with a poor or terrible credit rating only.

2. The Store Manager wants to see the total sales made since Winter opened. Run a query that
shoes the product description, unit price, total quantity sold and the total sales made for each
product. The Store Manager also wants to know when the last sales date was with the products
ordered from highest to lowest in terms of the total sales made.

Extra Resources
➢ More details on creating reports can be found here.

You might also like