Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.

Slides:



Advertisements
Similar presentations
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Advertisements

Jeopardy Objects Navigation Buttons True/False Parts of a Report Vocabulary Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final.
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Using Macros and Visual Basic for Applications (VBA) with Excel
Developing an Excel Application
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Chapter 5 Multitable Forms
Creating Custom Reports. 2 Design and create a custom report You can easily create custom reports based on a table or query. There are seven sections.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Access Tutorial 3 Maintaining and Querying a Database
Automating Tasks With Macros
Exploring Office Grauer and Barber 1 Creating More Powerful Applications: Introduction to VBA(Wk9)
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Automating Tasks with Macros. Macro Essentials  A macro is a list of actions that happen when you run the macro.  Creating a Macro: − Choose Create.
Access Tutorial 10 Automating Tasks with Macros
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Chapter 2 Querying a Database
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Maintaining and Querying a Database Microsoft Access 2010.
Microsoft Office 2007 Access 2007 Chapter 9 Administering a Database System.
Tutorial 6 Using Form Tools and Creating Custom Forms
® Microsoft Access 2010 Tutorial 6 Using Form Tools and Creating Custom Forms.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
XP Chapter 7 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Enhancing User Interaction Through Programming Chapter.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 7Automating, Customizing, and.
Enhancing User Interaction Through Programming
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
Chapter 1 Databases and Database Objects: An Introduction
Using Form Tools and Creating Custom Forms Microsoft Access 2010.
Chapter 6 Advanced Report Techniques
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
MICROSOFT WORD 2007 INTERMEDIATE/ADVANCED. CREATE A NEW STYLE BASED ON A SELECTED TEXT HOME tab > STYLES group dialog launcher > at the bottom of the.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
S511 Session 7, IU-SLIS 1 DB Implementation: MS Access Forms.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Create Forms Lesson 5. Objectives Software Orientation The Forms group (below) is located on the Create tab in the Ribbon and can be used to create a.
Automating Database Processing
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Key Applications Module Lesson 21 — Access Essentials
COMPREHENSIVE Access Tutorial 6 Using Form Tools and Creating Custom Forms.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Microsoft Access 2013 ®® Tutorial 10 Automating Tasks with Macros.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
Access Lesson 11 Creating and Running Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Microsoft Access 2010 Chapter 4 Creating Reports and Forms.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 2 ® Building Queries.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Using Macros, Switchboards, PivotTables, and PivotCharts
Plug-In T7: Problem Solving Using Access 2007
Microsoft Access Illustrated
Chapter 7 Advanced Form Techniques
Presentation transcript:

Automating Database Processing Chapter 6

Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive tasks – Add functionality to reports and forms Succeeding in Business with Microsoft Access 20102

Tools Covered in This Chapter Access Options Action Catalog AutoExec macro AutoKeys macro Breakpoints Events Macros Succeeding in Business with Microsoft Access 20103

Tools Covered in This Chapter Macro groups Macro security Navigation Forms Splash screen Trust Center Visual Basic for Applications (VBA) Succeeding in Business with Microsoft Access 20104

Level 1 Objectives: Automating Tasks with Switchboards and Macros Create a well-designed navigation form to provide a user interface for a database Automate tasks by creating basic macros Specify what happens when a database opens Succeeding in Business with Microsoft Access 20105

Understanding Navigation Forms Navigation Form – Special kind of form – Appears when database opened – Makes database navigation similar to a website Main navigation form and subform control automatically built in Drag and drop object to form and create tab – Selecting tab allows instant view of the objects Succeeding in Business with Microsoft Access 20106

Understanding Switchboards (continued) Can add buttons to main navigation form to work with – Tables – Forms – Queries – Reports Appear in hierarchical format Succeeding in Business with Microsoft Access 20107

Typical Switchboard Design Succeeding in Business with Microsoft Access 20108

Designing a Navigation Form Main navigation form serves as menu for users when database is opened Control user access to tables Review objects, plan categories to organize the objects on tabs Sketch a design for the navigation form Succeeding in Business with Microsoft Access 20109

Creating a Navigation Form Create lower level of the hierarchy first – Create tabs by drag and drop of object onto form Create main navigation form then created Click Navigation button in forms group of Create tab – Select tab layout – Change title and change format, if necessary – Drag forms or reports from Navigation Pane to the [Add New] tab – Use Layout view and Form selector button to change form location or size Repeat until all needed forms are on the navigation form Succeeding in Business with Microsoft Access

Creating a Navigation Form, Cont. Preview all forms in Form View – Test to ensure working correctly Create forms for reports as created for forms – Preview and test all tabs to ensure working correctly Create main form to provide easy navigation through database Last item on main form should be a button to close the database Succeeding in Business with Microsoft Access

Formatting a Main Menu Steps to changing the format of a main menu – Open the navigation form in design view – Change formatting elements Color Labels Images Lines – To change size and position properties, double click Form Selector button and change entries on form’s property sheet Succeeding in Business with Microsoft Access

Understanding Basic Macros Macro – Action or series of actions – Save time and ensure accuracy – Automate repetitive tasks – Composed of series of actions organized in sequence in which they should be performed Create macro – Using Macro window Succeeding in Business with Microsoft Access

Common Macro Actions Succeeding in Business with Microsoft Access

Creating a Macro Create Access macro in Macro window Select the Create tab, and then click the Macro button in the Macro & Code group Action catalog – Select features wanted – Actions to be performed – Click list arrow in action column – Click Add New and scroll through list to action you want Succeeding in Business with Microsoft Access

Creating a Macro (continued) Action arguments – Provide additional information for performing macro action – Arguments needed vary depending on selected action chosen Save macro with descriptive name, using mcr prefix Succeeding in Business with Microsoft Access

Running a Macro Three ways to run a macro: – In Macro Tools design tab, click the Run button in the Tools group – On database Tools Tab, click the Run Macro button in the Macro group Select the macron in the Run Macro dialog box, click – In the Navigation Pane, click Macros, right-click the macro name, and then click Run Succeeding in Business with Microsoft Access

Editing a Macro Use Macro Builder as in creating Rearrange order of actions – Drag action line to new position Insert new action between two existing actions – Click Add new and select the action – Move or drag the new action between the two other actions Delete action – Click action then click the delete button Succeeding in Business with Microsoft Access

Setting Startup Options Startup options – Access performs when database opens Set options using Access options feature Bypass Startup Options – Press and hold down shift key when opening database Succeeding in Business with Microsoft Access

Specifying Startup Options in the Startup Dialog Box Options – Display form – Display navigation pane – Allow full menus Succeeding in Business with Microsoft Access

Startup Dialog Box Succeeding in Business with Microsoft Access

Creating a Splash Screen Splash screen – Displays when database opens – Contains Logo Text Can only display splash screen or Navigation form automatically Succeeding in Business with Microsoft Access

Creating a Splash Screen (continued) AutoExec – Special macro – Runs when database opens – Before Access Options dialog box options – Can use to display splash screen Create splash screen form Succeeding in Business with Microsoft Access

Creating an AutoExec Macro Create macro that contains actions Access should perform when database opened Save macro using name AutoExec Succeeding in Business with Microsoft Access

Level 1 Summary Navigation Form – Special kind of form – Appears when database opened Macro – Use to automate repeated actions Access options dialog box Splash screen Succeeding in Business with Microsoft Access

Level 2 Objectives: Creating Advanced Macros Consolidate automated tasks by creating a macro group Specify conditions and events for macros Troubleshoot macros Succeeding in Business with Microsoft Access

Understanding Macro Groups Macro group – Two or more macros placed within same macro file – Consolidate related macros – Manage large numbers of macros – Only group name displayed as macro object in database window Succeeding in Business with Microsoft Access

Creating a Macro Group Logical to organize similar macros within group To create : – Click Create tab on the ribbon, click Macro button in the Macros & Code group – Click the Action Catalog button in the Show/Hide group on the Design tab – Add the Submacro Action to the Macro Builder – Enter unique name in the Submacro box – Click Add New Action arrow and select an action, select or enter the arguments – Repeat for each macro you want in group – Save the macro group using mcr prefix Succeeding in Business with Microsoft Access

Running the Macros in a Macro Group Clicking Run Button on the Design tab runs only the first macro in the group Run particular macro within group – Click the Run Macro button in the Macro group on the Database Tools tab – Select the list arrow to choose the macro name – Click the macro name – Click OK Succeeding in Business with Microsoft Access

Assigning AutoKeys to Macros in a Macro Group AutoKeys macro group – Assign macro to key or key combination Type key or key combination Use special notation – ^ for CTRL – + for Shift Uses subset of SendKeys command – Built-in commands to send keystrokes to Access databases Save group as AutoKeys Succeeding in Business with Microsoft Access

Examples of Key Combinations for the Autokeys Macro Group Succeeding in Business with Microsoft Access

Creating the Navigation Form to run macros using Command buttons Add Command button to a form – Click button to run a macro – Makes database actions easier for users Click the Button button in the Controls group Click in from where button is to be placed – Command button wizard starts Select category and then action to be completed – Repeat until all need buttons are on form – Save form Succeeding in Business with Microsoft Access

Specifying Conditions and Events for Macros Specify conditions for performing macro actions Assign macro to control Event-driven programming – Running macro when user interacts with object Event – State, condition, or occurrence that Access recognizes Event property – Specifies how object responds when event occurs Succeeding in Business with Microsoft Access

Specifying Where Conditions in a Macro Where condition argument Refer to controls on form that are not currently active – Use control’s complete name – Format [Forms]![formName]![controlName] Succeeding in Business with Microsoft Access

Troubleshooting Macros Macros containing arguments – Especially error prone Error types – Syntax error – Logic error – Run-time error Troubleshooting tools – Single step through execution of macro, using debug window – Print macro code – Use Visual Basic Editor Succeeding in Business with Microsoft Access

Printing Macros Open Documenter dialog box – Click macros tab – Select macro by clicking its check box – Click options button to select details of macro to print Properties Actions Arguments Permissions Succeeding in Business with Microsoft Access

Single Stepping a Macro Runs macro one action at time – Pausing between actions Make sure actions appear in correct order and with correct arguments Use Single Step button – Macro Single Step dialog box – Buttons Step Stop All Macros Continue Succeeding in Business with Microsoft Access

Setting Breakpoints Breakpoint – Code inserted in macro – Signals where to stop macro Examine values of actions, controls, and arguments macro using Open macro in the Microsoft Visual Basic for Applications window – Shows macro as it appears in VBA code – Examine details of macro code in VBA window Succeeding in Business with Microsoft Access

Setting Breakpoints Immediate pane – Displays current value of controls and arguments – Display using ? operator Succeeding in Business with Microsoft Access

Level 2 Summary Macro group Conditions for macros Assign macro to buttons Debug macros Succeeding in Business with Microsoft Access

Level 3 Objectives: Macro Conditions Assign a macro to an object event Run a macro when a form opens or a report prints Use a macro to validate data Succeeding in Business with Microsoft Access

Exploring Macro Conditions Macro conditions – Logical expressions that result in true or false answer – Depending on outcome Macro can perform one set of actions or another Enter macro conditions – Open macro in macro builder Drag the program flow action to macro builder – Set condition to test If condition true – Access performs SetValue action Succeeding in Business with Microsoft Access

Exploring Macro Conditions Add Else If condition to perform actions if False – Provides alternate action to perform Succeeding in Business with Microsoft Access

Assigning a Macro to an Object Event Assign macro to object – By specifying macro name in event property of object Event categories – Report – Section Succeeding in Business with Microsoft Access

Report Events and Section Events Succeeding in Business with Microsoft Access

Using Message Boxes with Forms Form events can also trigger macros Use to – Validate data – Set values – Navigate between forms – Filter, find, and print records Succeeding in Business with Microsoft Access

Form Events Succeeding in Business with Microsoft Access

Using Message Boxes with Forms MsgBox command – Opens message box – Displays warning or informational message – MsgBox ("message" sum of button and icon values "title") – Returns value depending on which button clicked – Create condition that checks to see which button users click Succeeding in Business with Microsoft Access

Using Message Boxes with Reports When conditions in macro references name of control from source – Source must be open when condition tested – Can hide window while macro tests condition MsgBox action – Opens message box and displays warning or informational message – Similar to using MsgBox command Succeeding in Business with Microsoft Access

Using Message Boxes with Reports (continued) MsgBox action arguments – Message – Beep – Type – Title Succeeding in Business with Microsoft Access

Validating Data with Macros Validation field properties have limits Validate data using more than one rule and more than one validation message – Create macro Domain aggregate functions – Calculate statistics for set of records (recordset) or domain, from table or query Dcount function – Dcount(expression, table or query, condition) Succeeding in Business with Microsoft Access

Common Domain Aggregate Functions Succeeding in Business with Microsoft Access

Level 3 Summary Conditional expressions in macros Assign macros to events Message boxes – Msgbox command – Msgbox action Validate data with macros Succeeding in Business with Microsoft Access

Chapter Summary Navigation Form – Provides main menu for Access application Macro – Automates repetitive tasks – Can use conditional expressions – Associate with command buttons or other controls Debugging – Find errors in macros by stepping though each statement Succeeding in Business with Microsoft Access