Return to Elective Courses
Access
Project 6
Creating an Application System Using Macros, VBA, and the Switchboard Manager
Introduction
Switchboard - is a form containing buttons which can be used for a variety of actions.
Clicking buttons will cause macros to be run
Macros - collections of actions designed to carry out specific tasks
Actions - various steps Access will execute in a macro
Introduction
Wizards - create button or combo box to your specifications and place it on the form
create event procedure for button or combo box
event procedure - series of steps that Access will carry out when an event , such as clicking a button occurs
Visual Basic for Applications
Event procedures are written in a language called Visual Basic for Applications, or VBA
do not even need to be aware that these event procedures exist. Access creates and uses them automatically.
Creating
and Using Macros
- Macro
- consists of a series of actions that Access will perform when the macro is run
- actions are entered in a special window called a Macro window
The Macro Window (Parts)
Action column - used to enter actions for macro to perform
actions selected from a pull-down list
arguments - additional information required by many actions (display in lower portion of Macro window)
Comment column - used to enter comments (brief descriptions of the purpose of the action)
More on Macros
Running a Macro - click Macros tab in Database window, right-click the macro, click Run on Shortcut menu
Modifying a Macro - right-click macro in the Database window, click Design on the shortcut menu, make the necessary changes
Errors in Macros
Microsoft Access dialog box - displays when macro error occurs, indicates the error and solution
Action Failed dialog box - indicates macro being run, the action Access was attempting to execute, and the arguments for the action
tells you which action needs to be corrected
Creating and Using
Command Buttons
Command button - executes a command when clicked
Control Wizards button - used to add command buttons
provide action that is taken when button clicked by using a series of Wizard dialog boxes
Several categories of Actions
Record Navigation category - used for Next and Previous record buttons
Record Operations category - used for Add and Delete record buttons
Form Operations category - used for the Close Form button
Creating, Using, Combo Boxes
Combo box - combines properties of a text box (type an entry) and a list box (display a list)
Combo Box Button - in toolbox used to create combo box
Combo Box Wizard - guides you through steps in adding a combo box
Issues with Combo Box
1. List not in
alphabetical order
2. When you move to a record without using combo box, name in combo box does not change to reflect name on the form
3. Pressing the
TAB key should not move to the combo box
Modifying Combo Box (Solutions)
1. + 2. Modify query Access created for combo box so that data is sorted by name then by the On Current property on entire form
ensures combo box kept current with rest of form
3. Change Tab Stop property for Combo box from Yes to No
Creating and Using Switchboard
Switchboard - special form with buttons to perform actions
buttons on main switchboard can lead to other switchboards
Switchboard Manager - used to create switchboard, use Add-Ins command on Tools menu
switchboard pages - individual switchboards within system
End
Access
Project 6
Computer Assignment 9
Return to Elective Courses