You are on page 1of 142

Access 2016/2013

Level 2

Copyright © 2015 30 Bird Media LLC


Course Objectives
After you complete this course, you will know:
 How to group and summarize queries, control relationship options for
cascading updates and deletes, and index tables to boost query
performance
 How to create and work with subforms, work with advanced control
types, and understand specialized form types
 Create subreports that allow users to view related data at the same
time, how to use grouping features to group by date ranges (such as
months) and to add running totals to a report, hot to exercise finer
control over formatting options such as alternating colors, showing
user names, image properties, and whether data show during printing
 How to create basic macros, use variables in macros, and
troubleshoot macros
 Compact and repair a database, restore a database from a backup,
and perform various maintenance tasks

Copyright © 2015 30 Bird Media LLC


Chapter 1: Advanced Queries
You will learn:
 How to group and summarize queries
 How to control relationship options for
cascading updates and deletes
 How to index tables to boost query
performance

Copyright © 2015 30 Bird Media LLC


Module A:
Understanding general database terms
This module provides an overview of:
 Grouping and summarizing
 Building queries using totals
 WHERE and Expression totals
 Common aggregate functions

Copyright © 2015 30 Bird Media LLC


Building totals queries

Copyright © 2015 30 Bird Media LLC


Building totals queries

Copyright © 2015 30 Bird Media LLC


Totals query design

Copyright © 2015 30 Bird Media LLC


Where totals

Copyright © 2015 30 Bird Media LLC


Expression totals

Copyright © 2015 30 Bird Media LLC


SQL View

Copyright © 2015 30 Bird Media LLC


Common aggregate functions

Copyright © 2015 30 Bird Media LLC


Common aggregate functions

Copyright © 2015 30 Bird Media LLC


Assessment: Grouping and summarizing
What aggregate function shows how much
individual values in a group vary from the
average? Choose the best answer.
A. MAX
B. MIN
C. VAR
D. WHERE
C, VAR, is correct.
Assessment: Grouping and summarizing

When you have both an Average total and an


Expression total in your query, what order
are they calculated in? Choose the best
answer.
A. Average then Expression
B. Expression then Average
C. Left column then right column
D. Having both will generate an error
A, Average then Expression, is correct.
Assessment: Grouping and summarizing

Having too many Group By fields in a Totals


query can give you very unfocused results.
True or false?Average then Expression
A. True
B. False
It’s true.
Module B: Updating, deleting,
and relationships
You will learn:
 About referential integrity options
 How to manage cascading updates
 How to manage cascading deletes

Copyright © 2015 30 Bird Media LLC


Cascading deletes

Copyright © 2015 30 Bird Media LLC


Allowing deletes in key fields

Copyright © 2015 30 Bird Media LLC


Allowing deletes in key fields

Copyright © 2015 30 Bird Media LLC


Allowing deletes in key fields

Copyright © 2015 30 Bird Media LLC


Allowing updates in key fields

Copyright © 2015 30 Bird Media LLC


Allowing updates in key fields

Copyright © 2015 30 Bird Media LLC


Assessment: Relational Databases
Which of the following will Access prevent you from doing in these tables? Choose
all that apply.

A. Deleting a record in Products


B. Deleting a record in Suppliers
C. Changing a Supplier ID in Products
D. Changing a Supplier ID in Suppliers
E. None of the above

B and D are correct.


Assessment: Relational Databases
Cascading updates and deletes can only
affect two tables at most. True or false?
A. True
B. False

That’s false.
Assessment: Relational Databases
When you perform a cascading update or delete,
Access will warn you about how many records in
the current table will be altered, but may not be
clear what records in other tables will be affected.
True or false?

A. True
B. False

It’s true.
Module C: Indexing for performance

You will learn:


 About Access indexes
 How to create a useful indexing strategy

Copyright © 2015 30 Bird Media LLC


About indexes

Copyright © 2015 30 Bird Media LLC


Creating indexes in tables

Copyright © 2015 30 Bird Media LLC


Assessment: Indexing for performance

What is the primary purpose of an index?


Choose the best response.
A. To speed aggregate functions
B. To speed queries
C. To speed table updates
D. To speed table sorting

B, to speed up queries.
Assessment: Indexing for performance
What is true about the Unique property on an
index? Choose the best response.
A. If a Unique index has two fields, each field must
be unique in each record.
B. If a Unique index has two fields, the
combination of both fields must be unique in
each record.
C. There can be only one field in a Unique index.
D. There can be only one Unique index per table.

The answer is B.
Assessment: Indexing for performance

One of the main benefits of indexing is that


it's as easy to index a long text field as it is
to index a numeric field. True or false?
A. True
B. False

That’s false.
Summary: Advanced queries
You should now know:
 How to produce more useful query results
using the Totals row, such as mathematical
aggregates, WHERE statements, and
expressions
 How to use referential integrity to prevent an
updated or deleted record in one table from
leaving orphaned records in related tables
 How to use indexes to boost query
performance without slowing table updates
Chapter 2: Advanced forms
You will learn how to:
 Create and work with subforms
 Work with advanced control types
 Understand specialized form types

Copyright © 2015 30 Bird Media LLC


Module A: Subforms
You will learn how to:
 Create a subform
 Use an existing form as a subform
 Use a linked subform

Copyright © 2015 30 Bird Media LLC


About subforms

Copyright © 2015 30 Bird Media LLC


About subforms

Copyright © 2015 30 Bird Media LLC


Form Wizard

Copyright © 2015 30 Bird Media LLC


Form Wizard

Copyright © 2015 30 Bird Media LLC


Subform Wizard

Copyright © 2015 30 Bird Media LLC


Subform Wizard

Copyright © 2015 30 Bird Media LLC


Using an existing form as a subform

Copyright © 2015 30 Bird Media LLC


Nested subforms

Copyright © 2015 30 Bird Media LLC


Linking forms

Copyright © 2015 30 Bird Media LLC


Linking forms

Copyright © 2015 30 Bird Media LLC


Main form–subform data relationships

Copyright © 2015 30 Bird Media LLC


Main form–subform data relationships

Copyright © 2015 30 Bird Media LLC


Main form–subform data relationships

Copyright © 2015 30 Bird Media LLC


Main form–subform data relationships

Copyright © 2015 30 Bird Media LLC


Assessment: Subforms
A subform displays related records from the
"one" side of a one-to-many relationship.

A. True
B. False

That’s false.
Assessment: Subforms
Which of these statements are incorrect? Choose all that apply.

A. The main form and subform contain properties you use to tell
Access what field links the two together.
B. Once those properties are set, you must sync the two forms
manually.
C. Any time you choose to include fields from two or more
tables, the Form Wizard automatically creates a form with
the subform.
D. If you rename a subform later, its link to the main form
automatically updates.

B and D are correct.


Assessment: Subforms
When using an existing form as a subform, if
the two forms aren't synchronized, you must
delete the form and start the procedure from
scratch.

A. True
B. False

That’s false.
Assessment: Subforms
Which of the following statements is incorrect?
A. If an existing form has a subform of its own, using it as a
subform results in each subform having a simple one-to-
one relationship with the main form.
B. A linked form allows you to choose the related data you
wish to view, rather than having the potential clutter and
confusion of viewing multiple subforms.
C. To use an existing form as a subform, drag the form you
want to use as a new subform from the Navigation pane
onto the main form.
D. When linking forms, the original form is called the "first
form," and the new, linked subform is the "second form."
A is not correct.
Module B: Advanced control types
You will learn how to:
 Link to other objects, including an email,
file, or web page
 Create and work with attachment controls
 Create and work with chart controls

Copyright © 2015 30 Bird Media LLC


Adding a hyperlink to a form

Copyright © 2015 30 Bird Media LLC


Adding a hyperlink to a form

Copyright © 2015 30 Bird Media LLC


The Web Browser control

Copyright © 2015 30 Bird Media LLC


The attachment control

Copyright © 2015 30 Bird Media LLC


Managing attachments in a form

Copyright © 2015 30 Bird Media LLC


The chart control

Copyright © 2015 30 Bird Media LLC


The chart control

Copyright © 2015 30 Bird Media LLC


The chart control

Copyright © 2015 30 Bird Media LLC


Assessment: Advanced controls
Which of the following statements is/are incorrect? Choose
the best answer.
A. A hyperlink object allows you to link to other
destinations, including other database objects, an email,
a file, or a web page.
B. It allows you to link to an email, a file, or a web page,
but not to other database objects.
C. When linking to an email address, any text in the "Text
to display" box become the Caption property.
D. When linking to a web address, the value from the
parameter "_dpw" in the website’s URL displays in the
search box and executes the search automatically.
The answer is B.
Assessment: Advanced controls
True or false? A distraction is an easy way to
expose functionality to end users that hides
the complex, sophisticated manner in which
the underlying code runs.

A. True
B. False

It’s false.
Assessment: Advanced controls
Which of these statements is/are correct? Choose any or all
that apply.

A. The tools for adding an attachment control to a form are


located in the Design tab's Tools group.
B. Attachments can also be added, removed, or opened for
editing from the Auxiliary Files window.
C. The tools for adding an attachment control to a form are
located in the Design tab's Controls gallery.
D. The real benefit of a chart control is that its chart can
automatically update as the data in its underlying records
change.

A, C, and D are correct.


Assessment: Advanced controls
True or false? If you don’t like the look and
feel of your chart, you can use the Microsoft
Graph application within Access, where you
can directly edit your chart's details.

A. True
B. False

That’s true.
Module C: Specialized form types

You will learn how to:


 Understand specialized form types and
when they might be used
 Work with navigation forms
 Work with modal dialog forms

Copyright © 2015 30 Bird Media LLC


Creating a navigation form

Copyright © 2015 30 Bird Media LLC


Modal dialog forms

Copyright © 2015 30 Bird Media LLC


Creating a database start-up form

Copyright © 2015 30 Bird Media LLC


Discussion: Specialized form types

Of the three types of specialized forms


discussed here—navigation forms, modal
dialog forms, and database start-up forms—
which would you think you could find uses
for in your day-to-day work?
Provide some examples of how you might
use them.
Summary: Advanced forms
You should now know how to:

 Create a subform, use an existing form as a


subform, and use a linked subform
 Link to other objects, including an email, file, or
web page; create and work with attachment
controls; and create and work with chart controls
 Understand specialized form types and when
they might be used, work with navigation forms,
and work with modal dialog forms
Chapter 3: Advanced reports
You will learn how to:
 Create subreports that allow users to view
related data at the same time.
 Use grouping features to group by date
ranges (such as months) and to add running
totals to a report.
 Exercise finer control over formatting
options such as alternating colors, showing
user names, image properties, and whether
data show during printing.
Copyright © 2015 30 Bird Media LLC
Module A: Subreports
You will learn how to:
 Identify the types of relationships
between main reports and subreports.
 Create subreports that share the same
record source with a main report.
 Create subreports with a different record
source than that of a main report.
 Create reports that contain two or more
unrelated subreports.
Copyright © 2015 30 Bird Media LLC
About subreports

Copyright © 2015 30 Bird Media LLC


About subreports

Copyright © 2015 30 Bird Media LLC


Main and subreport with the
same record source

Copyright © 2015 30 Bird Media LLC


Main and subreport with the
same record source

Copyright © 2015 30 Bird Media LLC


Using an unbound main report
as a container

Copyright © 2015 30 Bird Media LLC


Assessment: Subreports
Subreports do not have to be linked to the
main report that contains them. True or false?

A. True
B. False

That’s true.
Assessment: Subreports
Which of the following are ways to create a report with a
subreport? Choose all correct answers.

A. On the Create tab, click the Subform/Subreport button.


B. Place a Subform/Subreport control on an existing
report.
C. Use the Report Wizard.
D. Drag table, query, or report objects onto an existing
report.

B and C are correct.


Assessment: Subreports
There is never a good reason to have
unrelated subreports in the same main report.
True or false?

A. True
B. False

That’s false.
Module B: Creating Fields
You will learn how to:
 Summarize reports by date ranges such as
months, quarters, and years.
 Add running sums to reports for a
particular category field.

Copyright © 2015 30 Bird Media LLC


Date ranges

Copyright © 2015 30 Bird Media LLC


Date ranges

Copyright © 2015 30 Bird Media LLC


Running sums

Copyright © 2015 30 Bird Media LLC


Assessment: Advanced grouping
You can use the Report Wizard to group by
date ranges such as months, quarters, and
years. True or false?

A. True
B. False

That’s true.
Assessment: Advanced grouping
Running totals usually go in the Detail
section of a report. True or false?

A. True
B. False

That’s false.
Assessment: Advanced grouping
In which of the following objects can you use
running sums?

A. Tables
B. Forms
C. Queries
D. Reports

D, reports, is correct.
Assessment: Creating Fields
Which of the following are properties that are common
to all field types? Select all correct answers.

A. Required
B. Decimal places
C. New values
D. Caption

A, Required, and D, Caption, are properties common to


all field types.
Module C: Advanced formatting
You will learn how to:
 Use banding in report sections to
distinguish consecutive rows of
information.
 Show the current user name in a report.
 Control display and storage of images.
 Hide or show report information on
screen or when printing.
Copyright © 2015 30 Bird Media LLC
Banded reports

Copyright © 2015 30 Bird Media LLC


Showing and hiding for printing

Copyright © 2015 30 Bird Media LLC


Assessment: Advanced formatting
Banded colors are available for each section
of a report. True or false?

A. True
B. False

That’s true.
Assessment: Advanced formatting
Which function will show the user of the
report's name in a report? Choose the one
correct answer.
A. User()
B. Login()
C. CurrentUser()
D. CurrentLogin()

C and D.
Assessment: Advanced formatting
Which PictureType property value should you
use if you want to store an image with your
database? Select the one correct answer.

A. Linked
B. Embedded

B - Embedded.
Summary: Advanced reports
You should now know how to:
 Create subreports that allow users to view different data at
the same time, create subreports with the same record
source as their main reports, create subreports with data that
are related to that of their main reports, and create reports
that contain two or more subreports with unrelated data.
 Use grouping to display date ranges such as months, quarters,
and years, or to add running sums to various report sections.
 Use banding to distinguish rows or groups of data within a
report, show user names, control the storage and display of
images, and control whether data show during printing and
on screen.
Chapter 4: Macros
You will learn how to:
 Create basic macros
 Use variables
 Troubleshoot macros

Copyright © 2015 30 Bird Media LLC


Module A: Creating basic macros
You will learn:
 About macros
 How to create macros
 How to assign macros to events
 How to create data macros

Copyright © 2015 30 Bird Media LLC


Macro creation

Copyright © 2015 30 Bird Media LLC


Planning macros

Copyright © 2015 30 Bird Media LLC


Using the Macro Builder

Copyright © 2015 30 Bird Media LLC


Using Macro Builder features

Copyright © 2015 30 Bird Media LLC


Embedded macros

Copyright © 2015 30 Bird Media LLC


Assigning macros to events

Copyright © 2015 30 Bird Media LLC


Creating Data Macros

Copyright © 2015 30 Bird Media LLC


Assessment: Creating Basic Macros
OpenTable is an example of what? Choose the
best response.

A. An action
B. An event
C. A macro
D. An option

A, an action, is correct.
Assessment: Creating Basic Macros
You have a form that uses both an embedded macro and a macro
object. Which of the following are true? Choose all that apply.
A. If you copy the form to another database, the embedded
macro won't automatically come along.
B. If you copy the form to another database, the macro object
won't automatically come along.
C. If you delete the form, the embedded macro will be deleted
with it.
D. If you delete the form, the macro object will be deleted with
it.
E. Both are easy to reuse anywhere in the database.

B and C are correct.


Assessment: Creating Basic Macros
On Click is an example of what? Choose the
best response.
A. An action
B. An event
C. A macro
D. An option
B, an event, is correct.
Assessment: Creating Basic Macros
You can make sure certain conditions are
met before a table record is successfully
updated by using a Before Change
embedded macro. True or false?
A. True
B. False

That’s true.
Module B: Using variables
You will learn:
 About variables
 When to use variables
 How to insert variables into macros

Copyright © 2015 30 Bird Media LLC


Choosing variable sources

Copyright © 2015 30 Bird Media LLC


Creating macros with variables

Copyright © 2015 30 Bird Media LLC


Exercise: Sorting a Query

Copyright © 2015 30 Bird Media LLC


Assessment: Using variables
A macro you're reading opens with a SetTempVar
statement. Without reading anything else, what can
you say about the variable it creates? Choose all that
apply.
A. It can be used in any macro.
B. It can be used only in this macro.
C. Its value could be any valid expression.
D. It will be automatically deleted when the macro
finishes.
E. It may still be in memory after the macro finishes.
A, C, and E are correct.
Assessment: Using variables
When you're setting a variable's value, you
want to add a custom expression from a VBA
module. Which Expression Builder node
should you look in? Choose the best response.
A. Common Expressions
B. Functions
C. DatabaseName.accdb
D. Operators
It’s B, Functions.
Assessment: Using variables
In Access, all variables must be declared at
the beginning of the macro. True or false?
A. True
B. False
That’s false.
Module C: Troubleshooting macros
You will learn:
 About error handling tools
 How to debug macros
 How to design more robust macros

Copyright © 2015 30 Bird Media LLC


Error handling

Copyright © 2015 30 Bird Media LLC


Stepping through macros

Copyright © 2015 30 Bird Media LLC


Displaying variable values

Copyright © 2015 30 Bird Media LLC


Using the OnError action

Copyright © 2015 30 Bird Media LLC


Using the MacroError Object

Copyright © 2015 30 Bird Media LLC


Assessment: Troubleshooting macros
Which OnError option is the same as not using an
OnError statement at all? Choose the best
response.

A. Fail
B. Macro Name
C. Next
D. None of the above

A is correct.
Assessment: Troubleshooting macros
ou want an error message to display the
description generated by the error itself. What
expression element would you use in the
MessageBox action? Choose the best response.
A. Diagnostics].[Description]
B. [MacroError].[Description]
C. [OnError].[Description]
D. [USysApplicationLog].[Description]
B is correct.
Assessment: Troubleshooting macros
A logic error is any error that causes the
macro to stop and generate an error
message. True or false?

A. True
B. False

That’s false.
Summary: Macros
You should now know:
 How to plan macros, and how to use the
Macro Builder to create macro objects,
embedded macros, and data macros.
 How to define variables in a macro, using
appropriate scopes for appropriate tasks.
 How to design more robust macros through
error handling tools and user-focused
design, and how to debug macros when
they experience problems.
Copyright © 2015 30 Bird Media LLC
Chapter 5: Database management
You will learn how to:
 Compact and repair a database
 Restore a database from a backup
 Perform various maintenance tasks

Copyright © 2015 30 Bird Media LLC


Module A: Compact & Repair
You will learn how to:
 Prepare a database to be compacted and
repaired
 Compact and repair the database
 Set the database to compact and repair
automatically

Copyright © 2015 30 Bird Media LLC


Running Compact & Repair

Copyright © 2015 30 Bird Media LLC


Assessment: Compact & Repair
True or false? Running Compact & Repair can
eliminate problems caused by temporary,
unused, and deleted objects, but it can't fix a
corrupted database.

A. True
B. False

That’s false.
Assessment: Compact & Repair
Which of the following statements is/are incorrect?
A. Temporary objects remain part of a database file
only until you close it.
B. When you delete database objects, the file space
reserved for them isn’t automatically freed up.
C. Access isn't necessarily the best tool for
environments in which many users must have
simultaneous access to a single database.
Statement is A is incorrect.
Assessment: Compact & Repair
True or false? It's a good idea to back up
your database prior to running Compact &
Repair.

A. True
B. False

That’s true.
Module B: Restoring a database
You will learn how to:
 Restore a database from a backup

Copyright © 2015 30 Bird Media LLC


Assessment: Backup & Restore
Which of these statements is/are correct? Choose all that
apply.
A. If there’s an object with the same name already in the
database, Access still imports it by overwriting the object
with the same name.
B. To restore a prior version of a database, click
Remembrance of Databases Past.
C. To restore a prior version of a database, click Restore
Database.
D. It's important to rename any imported objects;
otherwise actions related to them will not function
correctly.
D is correct.
Module C: Other maintenance tasks
You will learn how to:
 Encrypt a database
 Create an executable file
 Document database structure

Copyright © 2015 30 Bird Media LLC


Encrypting a database

Copyright © 2015 30 Bird Media LLC


Creating an executable file

Copyright © 2015 30 Bird Media LLC


Documenting the database structure

Copyright © 2015 30 Bird Media LLC


Assessment: Other maintenance tasks

True or false? If a database is password


protected, and the password is forgotten, the
only way to restore the file is by obtaining the
password through Microsoft Support.

A. True
B. False

That’s false.
Assessment: Other maintenance tasks
Which of these statements is/are incorrect? Choose an or all that
apply.

A. If no one knows the password to a password-protected database,


the database can't be recovered.
B. Creating an executable file for a database creates the same level of
protection as encrypting it with a password.
C. The three methods of protecting a database are by encrypting it
with a password, by creating an executable file, and by saving it as
an ACCDBPW file.
D. Although executable files aren't considered as strongly encrypted
as password-protected files, they do keep users from opening,
deleting, or modifying your VBA code, forms, and reports.

Answer B is correct.
Assessment: Other maintenance tasks

True or false? If you decide not to back up


your databases, you can use the Database
Documenter to recreate a database and all its
objects.

A. True
B. False

That’s false.
Summary: Database management
You now know how to:
 Prepare a database to be compacted and
repaired, compact and repair the database,
and set the database to compact and repair
automatically
 Restore a database from a backup
 Encrypt a database; create an executable
file from a database; and document
database structure, including all its objects,
macros, and VBA code
Copyright © 2015 30 Bird Media LLC

You might also like