This class begins our exploration of Macros and
Event Handling. We will start by discussing what macros are,
their benefits, their limitations, and review the few macros we've
already built into our class PC Resale database.
Next we will learn how to
build standalone macros that can be run from the
database pane, in addition to embedded macros that can
be placed in a button or form/report control. We will learn about the
Macro Builder, Action Catalog, Beep command, MessageBox command, command
arguments, OpenForm command, where conditions and
filters, and the On Click event. We will build a button to open the
Customer List Form.
We will learn how to make
smart macros. You will create an On Double
Click Event which will allow you to double-click on a customer
ID in the list form and open that customer's record directly. We'll do
the same thing with contacts and orders. You will learn about If
/ Then / Else statements which allow your macros to make
decisions. You'll learn the MessageBox and StopMacro commands.
We will take some time to
go over all of the different Form Events so that you
know when to use which Event in each situation. There are a lot of them,
and each has it's own use.
We'll spend even more time on macro
conditions. One of my pet peeves is opening a form,
making some edits, and then returning to the list form and not seeing
the changes update on the list form. We'll use the On Activate
event to fix that problem. We'll also see how to use the CancelEvent
command and the On No Data Event to stop a report from opening if it has
no records. Good stuff.
This is the 1st class in the Access Advanced series. If you're
serious about building quality databases with Access, and you want to
begin learning how to automate your database with Macros
and Events, which is a good pre-cursor to VBA
programming then don't miss out on
this course. Of
course, if you have any questions about whether or not this class is
for you, please contact me.
Complete Outline - Access
Advanced Level
1
00. Intro (2:31)
01.
Macro Basics (13:40) What is
a Macro? Benefits of Macros Limitations of Macros
Review of Macros in our Database
02. Building Macros (14:47)
Create a Standalone Macro Create >
Macro Macro Builder Action Catalog Beep Command
Delete a Command from Macro MessageBox Command Command
Arguments Hello World Example OpenForm Command Where
Condition v Filter Embedded Macro in Form Button Build
Event On Click Event |
03.
Making Macros Smart (16:58)
Macro to Open Form to Specific Record
On Dbl Click Event
= Sign Required in Where Condition
Blue Fields Double-Clickable
ControlTip Text
Open Specific Contact
If Then Command
IsNull Function
If Not IsNull
Add Else Condition
MessageBox Command
StopMacro Command
Show Orders for Specific Customer
04. Form Open
Events (15:29)
More With Conditions
Open Specific Order from OrderListF
Requery a Form when you return to it
On Activate Event Example
Discussion of Other Events:
On Open, On Close
On Resize
On Activate, On Deactivate
On Load, On Unload
On No Data Event for Reports
CancelEvent
05. Review
(4:44)
|
|