Title: Macros
1Tutorial 10
2Macro
- A command or series of commands you want to
perform automatically - Automates repetitive tasks
- Opening forms
- Printing selected record forms
- Running Queries
3Types of GUIs
- Message Box
- List Box
- Command Button
- Switchboard
- Organize info for the user
- Restrict user access to underlying data/formats
4Message Box
Message Box
5Command Buttons
Command Buttons
6Captions
Hot Key
7Event
Event Tab
8OnClick Event Property
Event Property
9List Box
List Box
10List BoxSQL Statement
Refer back to page AC 520 Fig 10-29 for codes
Query Code 5
Source Data SQL Statement
11Group Macros
12Group Macros-Open Form in Form View
13Switchboard
Command Buttons
14Switchboard in design view
15Tile Vertically
Tile Vertically
16Macros vs Visual Basic for Applications (VBA)
- Macros
- Easier to build and use
- Good for simple tasks
- VBA
- Better error-handling
- Better for making changes
- Cannot use VBA to display a switchboard or assign
actions to a specific key
17Tutorials 10 and 11 are linked
- VBA statements in Tutorial 11
18Terms
- Actions-an instruction to perform a task, i.e.
open a form - Arguments-facts the program needs to execute the
actions, i.e. open the Employer Data form - Events-occurs when you take some action, i.e.
clicking a button, using the mouse or pressing a
key - Event Properties-how an object responds to the
event, i.e. OnOpen, OnClose or OnActivate - Procedures-a group of executable statements
19Review Assignment Switchboard
20Review Assignment-Reports Dialog Box
21Review Assignment-SQL Statement
Code for reports -32764 Remember page AC 520
for codes
22Review Assignment Group Macro
23Switchboard Manager
24Switchboard Manager
Yes
25Switchboard Items Table
Delete this item if you are having trouble with
the Switchboard Manager and try again
26Switchboard Manager
27Review Assignment
- Step 2. create a Queries Dialog Box form-ref pg.
514 - Step 2b. SQL statement ref pg. 521 - remember to
use the Report Code from Fig. 10-29 - Step 2d. Command buttons-ref pg. 522-524
- Step 3. create a group macro-ref pg. 529
- Step 4. create a switchboard ref pg. 534
28Final Projects
29Lets do Tutorial 10