Macros - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Macros

Description:

... Switchboards ... Switchboard. Menu of options. Special Access form that appears when one ... Create nested set of switchboard forms with command buttons to ... – PowerPoint PPT presentation

Number of Views:114
Avg rating:3.0/5.0
Slides: 15
Provided by: garybr
Category:

less

Transcript and Presenter's Notes

Title: Macros


1
Macros Switchboards
2
Introduction
  • The Access database window is used for
    development and maintenance of the database by
    technical staff
  • The end user needs a different interface
  • Ease of use
  • Prevent accidental change of objects

3
Custom Interface
  • One may design a special interface
  • Containing only the options a user needs to see
  • Normally this would be a set of nested menus
    providing access to forms, reports, and queries

4
Switchboard
  • Menu of options
  • Special Access form that appears when one opens
    the database
  • Controls user access
  • Typically switchboards contain
  • Command buttons
  • Restricted menu bar no design change options
  • Hidden toolbar so user doesnt change design
  • Shortcut keys (hot keys) underlined characters
    used with Alt key
  • Text boxes and pictures for clarity and visual
    appeal

5
Switchboard
  • Gains its power from Macros and Visual Basic for
    Applications (VBA)
  • Macro
  • Series of commands that Access performs
    automatically
  • Automates repetitive tasks
  • Each command is called an action
  • For example, open a form, print selected records,
    display a query
  • One builds macros by selecting actions from lists
  • Best for small applications and simple tasks

6
VBA
  • Also automates tasks
  • Programming language requiring knowledge of
    syntax
  • Many advantages over using macros
  • Allows more sophisticated customizations
  • Best for large applications and complicated tasks
  • Better error handling
  • One has much more control over options

7
Actions
  • Action instruction to perform an operation
  • May add from list box
  • May drag database object to design row to add a
    default action

8
Actions Created by Dragging
  • Object Dragged Action Created
  • Table OpenTable
  • Query OpenQuery
  • Form OpenForm
  • Report OpenReport
  • Macro RunMacro

9
Event
  • Taking a certain course of action causes an event
    to occur
  • End users usually initiate events
  • For example,
  • Clicking a button
  • Pressing a key
  • There are many events in Access
  • When you open a form, you perform the Open event
  • When the form becomes the active window, the
    Active event has occurred
  • When you close a form window, you perform the
    Close event

10
Event Property
  • How an object responds when an event occurs
  • Each object has many events associated with it
  • For example,
  • OnClick event property for a command button
    specifies what happens when it is clicked
  • A macro or VBA code could designate what happens

11
Macro Groups
  • One may combine macros into groups
  • Macro groups contain other macros
  • These are easier to manage, not so many macro
    objects
  • May define macro names within the group
  • Then reference individual macros in a group by
    name

12
Switchboards
  • Custom set of menus
  • Provides a customized graphical user interface
  • Allowing the end user to select and run the
    database objects
  • Without using the Access database design windows

13
Switchboards
  • Creation steps
  • Create macro group containing the menu macros
  • Create nested set of switchboard forms with
    command buttons to act as control menus
  • Associate macros with command buttons

14
End
Write a Comment
User Comments (0)
About PowerShow.com