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.

Slides:



Advertisements
Similar presentations
Microsoft® Access® 2010 Training
Advertisements

Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
1 Microsoft Access 2002 Tutorial 9 – Automating Tasks With Macros.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Automating Tasks With Macros
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
EGR 141 Computer Problem Solving in Engineering and Computer Science Interfacing with a Database in Visual Basic.NET 2005.
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
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.
GroupWise Tips Shortcut Keystrokes Create a new mail message CTRL + M Create a new phone message CTRL + SHIFT + P Create an appointment for.
Access Lesson 4 Creating and Modifying Forms
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
Access Ch 5 Review.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Access Tutorial 10 Automating Tasks with Macros
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
Microsoft Office 2003 Illustrated Introductory with Programs, Files, and Folders Working.
Advanced User Guide to Outlook and all its features.
Working with a Database
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 7Automating, Customizing, and.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
| | Tel: | | Computer Training & Personal Development Outlook Express Complete.
Creating a Web Site to Gather Data and Conduct Research.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
XP New Perspectives on Microsoft Access 2002 Tutorial 21 Microsoft Access Tutorial 2 – Creating And Maintaining A Database.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
S511 Session 7, IU-SLIS 1 DB Implementation: MS Access Forms.
MS-ACCESS BY SANGEETHA PARTHASARATHY Topics to be covered §Comparing Values in Selection Criteria §Calculating Values in a Query §Changing the appearance.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Automating Database Processing
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T6: Basic Skills and Tools Using Access 2010 Business Driven Technology.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
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.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
® Microsoft Access 2010 Tutorial 10 Automating Tasks with Macros.
Access Lesson 11 Creating and Running Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
OBJECTIVES  Understand relational databases  Explore a database  Create a database  Create a table  Create primary keys  Relate two tables  Enter.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Printing Reports. Creating Reports  Reports are the best way to put information from database onto paper, PDF files, and other formats.  In a report,
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Word and the Writing Process. To create a document 1.On the Start menu, point to Programs, and then click Microsoft Word. A new document opens in Normal.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
Excel Tutorial 8 Developing an Excel Application
Using Macros, Switchboards, PivotTables, and PivotCharts
Building a User Interface with Forms
Accsess 2013 Creating Database.
Microsoft Access Illustrated
Chapter 7 Advanced Form Techniques
Exploring Microsoft Office Access 2007
MODULE 7 Microsoft Access 2010
DB Implementation: MS Access Macros
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Microsoft Office Access 2003
Tutorial 10 Automating Tasks with Macros
Presentation transcript:

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  Macros & Code  Macro. − Choose first action in the Add New Action list. − Fill in the arguments for your action, using the text boxes that appear under it.

Macro Essentials  Running a Macro: there are four ways to run a macro. − Run it directly by double-click its name in Navigation pane, Or, if the macro is open, choose Macro Tools | Design  Tools  Run. − Can trigger it using a keystroke. − Run it automatically when the database is first opened. − Attach macro to a form.

Editing a Macro  Open macro in Design view − Change action arguments. − Reorder actions. − Add a new action. − Remove an action. − Add comments.

Collapsing, Expanding, and Grouping Macro Actions  Collapsing, Expanding: by simply clicking the +/– button that appears to the left of the action name. − Collapsing: hide some of this information. − Expanding: Expand the action back into view.  Grouping Macro Actions: subdivide a single macro in sections that help you concentrate on the portion of the macro that interests you.

Collapsing, Expanding, and Grouping Macro Actions  To create a group: − In the Add New Action list, choose Group.It’s the second entry. − Enter a group name. − Add actions to your group.  Every group starts with the group name and ends with the text “End Group”. In between are the actions of the group.

Collapsing, Expanding, and Grouping Macro Actions  Example:

Solving Macro Problems  These steps to use single-step debugging: − Open macro in Design view. − Choose Macro Tools | Design ➝ Tools  Single Step. − Choose Macro Tools | Design ➝ Tools ➝ Run − Click Step, Continue, or Stop All Macros, depending on what you want to do next.

Managing Macros  To manage macros, can use the sub macro feature. − A sub macro is a small, named bundle of actions. − The nifty of sub macros is can put many sub macros into a single macro object. − Using sub macros, you can keep related functionality close together, easier time finding the macro you need.

Managing Macros  To create sub macros: − Opening an existing macro − Choose Sub macro from the Add New Action list. − Or drag the Program Flow ➝ Sub macro action from the Action Catalog and drop it onto your macro − Either way create a new blank sub macro.

Managing Macros  Two ways to add a Sub macro:

Configuring a Startup Macro  Macro AutoExec: − Macro automatically run when open database − Macro always include the actions like:  Opens a few important forms and reports.  Imports data from another file.  Runs a cleanup query. − Macro name is AutoExec

Connecting Macros to Forms and Tables  Understanding Events: A form has three types of events: − Control events: These events are the most useful. They happen when you do something with a control. − Section events: forms are divided into sections, each section has its own events. − Form events: includes events that fire when the form is opened, closed, when move from one record to the next and an update.

Connecting Macros to Forms and Tables  To see the list of events for a form’s different parts: − Open your form in Design mode. − Select the item that has the events you want to examine. − In the Property Sheet, choose the Event tab. − Select event appropriate.

Attaching a Macro to an Event  Create and save a macro.  Open form in Design view, and make sure the Property Sheet is visible.  Select a control, a section, or the entire form.  In the Property Sheet, choose the Events tab, and then find the event you want to use.  In the Event box, click the drop-down arrow, and choose the macro you want to use.

Conditional Macros  Conditional Macros: perform conditional actions. − To create a conditional macro, need to use the If action:  Select the If action from the Add New Action list  Drag If action from the Program Flow section of the Action Catalog. − The If action requires a single argument, which is a condition.

Conditional Macros  Here’s how it works: − If the condition turns out to be True, Access runs the actions in the If box. − If the condition turns out to be False, Access skips over the actions in the If box and continues with the next action after the If action.

Conditional Macros  Building a Condition: − Use the compare operators: =, <>, = − Logical operator: And & Or. − Functions:  IsNull()  Len()  …

Data Macros  Data Macros is a macro run when an event occurs in a table.  Data macros respond to table events like create a record, edit a record, and send an .  Data macros support a different set of actions.  Data macros can stick with database even when transfer it to another platform.

Data Macros  Table Events: EventDescription Before Change Occurs just before Access commits an edit or inserts a new record. If you need to distinguish between the two, you can create conditions that use the IsInsert property, which is True for inserts and False for updates. Before Delete Occurs just before Access removes a record from a table After Insert Occurs after Access has finished inserting a new record. After Update Occurs after Access has finished updating a record after an edit. After Delete Occurs after Access has removed a deleted record from the table.

Data Macros  Example: Create a data macro that prevents a blank value for Address: − Open table in Datasheet view. − Choose Table Tools  Table  Before Events  Before Change. − Add the actions you need:  If action tests to see if the rules are being broken. [Wants ]=Yes And IsNull([ Address]).  RaiseError action cancels the change and provides an error message.