Microsoft Access 2002 Tutorial 9 Automating Tasks With

Microsoft Access 2002 Tutorial 9  Automating Tasks With

Microsoft Access 2002 Tutorial 9 Automating Tasks With Macros 1 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access. Often users should not be given full access to Access

provide an interface that removes the user away from the Access interface. A Graphical User Interface (GUI) is a collection of windows, menus, dialog boxes and other graphical components used to communicate with a program. Often, the first view of a custom GUI is a switchboard. 2 What is a switchboard? A

form that opens when you start the underlying database. Usually used to provide the user with a set of choices. Eliminates the need for users to interact directly with the database window. Can prevent users from making bad changes to form layout etc. The form you create for the switchboard is called a dialog box, which asks for user input in the way of a selection. 3 An example of a switchboard The figure below is an example of a switchboard form. The user

would use this form to open the various objects in the database. Notice that this switchboard provides command buttons to provide access to all the options available to the user. 4 Macros Small program with a series of actions Actions are repeated whenever macro is invoked. An action is an instruction to Access to perform an operation, such as opening a

form or displaying a query. Once the macro has been created, you can add actions to it by editing the macro in the Macro window. 5 Use the Macro window to add actions It is within the Macro window that you will supply the action name (chosen from a list), any comments you

want to make, and the arguments for the action. Arguments are additional facts needed to run the action. Each type of action has its own set of arguments. A commonly used action is the Msgbox action, which will display a message to the user by way of a small form. Another commonly used action is the FindRecord action that will find the first record matching a set of criteria. 6 The Macro window This figure shows the Macro Window. In this window you can add macro actions and set the arguments for the macro actions.

Notice also the lower section of the window. This section contains the properties for the currently selected action. Notice that each action has a comment column. This column is used to document the macro. It is a good idea to write a comment about how this particular action7 will be used. Single-Step a macro When you run a macro, the series of

actions are executing one after the other. Sometimes it is useful to test the macro one step at a time. This is called single stepping and causes the macro to perform one action, then waits for you to step to the next action. Can gain a clearer view of how the macro is working. 8 Create a macro Start with a blank macro and then add the actions to it.

Drag an action from the database windows into the macro window. Each type of object has a default set of arguments. For example, if you drag a table into the macro window, the default arguments are to open the table in datasheet view in edit mode. Drag as many objects as you want to the macro window. You can either accept the default arguments or you can edit them to meet your needs.

Run the macro and observe the results of the macro. 9 Macro Groups A macro group is a macro that contains other macros. If you have several small related macros, you might consider grouping them together with other small macros in a macro group. Makes it easier to maintain a large collection of macros. 10

Add a macro to a macro group Each individual macro within the group will have a name assigned to it. MacroGroupName.MacroName When you add a macro to a macro group, you add a new name to the Macro Name column. However, if you are simply adding an action to a macro within the group, you add only the new

action in the Action column under the macro name. 11 A macro group with two macros In the figure below, you see an example of a Macro group window. Notice the new column added for the Macro name. Each macro in the group will contain a name in this column. Actions that will be taken within that macro will appear in the action column but without a name. 12 Use the Switchboard Manager to create a switchboard First,

create all the macros you will need for the switchboard and then create the switchboard that will execute the macros. Use the Switchboard Manager to create the switchboard. The Switchboard Manager allows you to specify what buttons should be on the switchboard and identify the command to execute when each of the buttons is clicked. 13 Switchboard considerations Only one switchboard for a database; however, the switchboard can contain

multiple pages. The main page of the switchboard will display when the switchboard opens. You can place buttons on the main page that will cause other pages in the switchboard to open. 14 The completed switchboard This final figure shows the complete switchboard, which has buttons for each of the objects with which the user can interact.


Recently Viewed Presentations



    Cmpe 259: Sensor Networks. MATTHEW HENDRICKS. WIRELESS SENSOR NETWORKS. Requirements: Made up of several nodes/sensors. Nodes consist of a CPU, storage, transmitter, and battery. Communications sometimes take many hops to reach the sink. Scalability of sensor networks
  • Ethernet Passive Optical Networks

    Ethernet Passive Optical Networks

    Ethernet Passive Optical Networks Example of EPON architecture for Access Networks Ethernet Passive Optical Networks Transmissions in an EPON Downlink Broadcasting ONUs select their packets based on MAC address Uplink ONUs compete for using the channel CSMA cannot be used,...
  • Honors Biology -

    Honors Biology -

    Business Communications. Ms. Alnita Williams. [email protected] What We Will Learn. Students will create, edit, and publish professional appearing business documents with clear and concise communication.
  • Map Information Tool (MIT2)

    Map Information Tool (MIT2)

    Beta user testing 1.5 FTEs $10K Autodesk software SQL Server Database Hardware * Lessons Learned Requires robust infrastructure Re-use or leverage existing data Talk to users early Abstract everything Plug-and-play business systems Re-usable map components Plan for growth and integration...
  • 6.1 Characteristics of Living Things

    6.1 Characteristics of Living Things

    ? To edit the type of question or choices, go back to the "Ask Students a Question" in the Pear Deck sidebar. Grow and Develop. All living organsims move through life stages. Reptile's offspring grow and develop in eggs. Mammals...
  • Notes:Color Guide - PC\|MAC

    Notes:Color Guide - PC\|MAC

    Newton's First Law of Motion: An object will maintain its velocity (speed & direction) unless acted on by an unbalanced force. Newton's first law of motion describes the inertia of an object. An object's tendency to maintain its current state...
  • IN Training (Part 1)

    IN Training (Part 1)

    Overview of Deaf-Blindness . Describes a variety of combinations of vision and hearing loss . Approximately 10,000 children in the U.S. (birth to 21 years old)
  • Binary Compounds - Mr. Cope's Classes

    Binary Compounds - Mr. Cope's Classes

    Writing a Formula Example. Write the formula for the ionic compound that will form between Ba and Cl. Find the charges of each element from their placement on the periodic table.