INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.

Slides:



Advertisements
Similar presentations
Chapter 1 Getting Started with Access Databases. Objectives Identify Good Database Design Create a Table and Define Fields in a New Blank Database Change.
Advertisements

With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 7 Advanced Forms and Reports 1 Copyright.
INSERT BOOK COVER 1Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 Committed to Shaping the Next Generation of IT Experts. Office Fundamentals Robert.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Eric Cameron, Cyndi.
With Microsoft ® Excel 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel.
With Microsoft ® Office 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office.
With Microsoft® Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
With Microsoft Access 2010© 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Getting Started with Microsoft SQL Server 2012 Express Edition Appendix A DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 10 Using Macros and SQL in Access 1.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
Getting Started with Microsoft Access The Access Workbench: Section One DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 4 th Edition.
Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. 1 by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson,
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Getting Started with Oracle Database 11g Release 2 Express Edition Appendix B DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 6 th Edition.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Word 2010 by Robert Grauer, Michelle Hulett, and Mary.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1: Finding Your.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 1 Workshop 1 The Four Main Database Objects Series Editor Amy Kinser.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 2 Workshop 4 Accessing, Maintaining, and Presenting Information Series.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 10 Customizing a Database.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 4: Share, Compare and Document Robert Grauer, Keith.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
Key Applications Module Lesson 21 — Access Essentials
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Chapter 7 Advanced Queries Robert.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. Access Module 2 Workshop 3 Queries and Data Access Series Editor Amy Kinser by.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Word 2010 by Robert Grauer, Michelle Hulett, and Mary.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast, Mary Anne Poatsy Chapter.
Microsoft Access 2013 ®® Tutorial 10 Automating Tasks with Macros.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith Mulbery, and Mary.
1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Mary Anne Poatsy, Keith Mulbery, Lynn Hogan, Amy Rutledge, Cyndi Krebs, Eric.
Access Lesson 11 Creating and Running Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith Mulbery, and Mary.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Skills for Success with Microsoft Office 2013 Volume 1 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall. by Kris Townsend, Catherine.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Create, Edit,
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
By Mary Anne Poatsy, Keith Mulbery, Eric Cameron, Jason Davidson, Rebecca Lawson, Linda Lau, Jerri Williams Chapter 6 Action and Specialized Queries 1.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne.
© 2013 Pearson Education, Inc. Publishing as Prentice Hall1 with Microsoft ® Office for Mac 2011 Common Features Using the Common Features of Microsoft.
1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office 2010 Fundamentals by Robert Grauer, Lynn Hogan, and Mary.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
Exploring Microsoft Office Access 2007
Exploring Microsoft Office Access 2007
GO! with Microsoft Office 2016
GO! with Microsoft® Access e
Exploring Microsoft Office Access 2007
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Excel Datasets and Tables
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Presentation transcript:

INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Access 2010 by Robert Grauer, Keith Mast, and Mary Anne Poatsy Chapter 10 Using Macros and SQL in Access

Objectives Understand the purpose of a macro Create a stand-alone macro Use the Macro Builder Attach an embedded macro to an event Identify when to use a data macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 2

Objectives (continued) Create an event-driven data macro Create a named data macro Understand the fundamentals of SQL Interpret an SQL Select Statement Use an SQL Select Statement as a record source Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 3

Understand the Purpose of a Macro Macro – a series of actions that can be programmed to automate tasks Event – occurs when a user enters, edits, or deletes data; events can also occur when users open, use, and close forms and reports Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 4

Understand the Purpose of a Macro (continued) Two types of macro: – Stand-alone macro – a database object that you create and use independently of other controls or objects – Embedded macro – a macro that executes when an event attached to a control or object occurs Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 5

Understand the Purpose of a Macro (continued) Two examples of an event attached to a control: – After Update event Triggered each time you enter (update) data into a field on a form – On Close event Happens whenever you close a form or a report When triggered Access will execute the steps stored in the macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 6

Understand the Purpose of a Macro (continued) Figure 10.1 Stand-Alone Macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 7 Stand-alone macros appear in Navigation Pane

Understand the Purpose of a Macro (continued) Figure 10.2 Embedded Macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 8 Command Button Property Sheet Embedded macro attached to On Click event Command button control

Understand the Purpose of a Macro (continued) Two methods to create an embedded macro: – Access wizard – A macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 9

Create a Stand-Alone Macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 10 To start the Macro Builder: – Click the Create tab – Click Macro in the Macros & Code group When you finished building the macro: – Click Save – Type a descriptive name for the macro To run a stand-alone macro: – Double-click the macro name in the Navigation Pane or select the macro and press Enter

Create a Stand-Alone Macro (continued) To edit a macro: – Right-click on the macro name in the Navigation Pane – Select Design View from the shortcut menu After modifying the macro: – Save – Close the macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 11

Use the Macro Builder Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 12 Macro Builder – enables you to create and edit macros Argument – a variable, constant, or expression that is needed to produce the output for an action

Use the Macro Builder (continued) Figure 10.3 Macro Builder Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 13 Click Macro to open the Macro Builder Add macro actions here Use the Action Catalog to find and add actions

Use the Macro Builder (continued) Figure 10.4 Macro Action with Arguments Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 14 MessageBox action has four arguments: Message, Beep, Type, and Title.

Attach an Embedded Macro to an Event Embedded macros: – Attached to an event of a control on a form or report, or to an event of the form or report object itself – Open in Design view to attach an embedded macro To attach a macro to an event: – Add a control that automatically creates an embedded macro using the Command Button Wizard – Attach an embedded macro to an event using the Property Sheet Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 15

Attach an Embedded Macro to an Event (continued) Figure 10.6 Create an Embedded Macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 16 Select the Macro Builder in the Choose Builder dialog box After Update event is selected Click Build

Identify When to Use a Data Macro Data macros are only used with table events and not with other objects A form based on a table that contains a data macro will inherit the logic of the table Examples of when to add a data macro to a table: – Verify that a customer has no outstanding invoices – Keep a log of any changes made to a specific table – Send a confirmation Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 17

Create an Event-Driven Data Macro Event-driven Data Macros – Triggered when a table event, such as After Delete or Before Change, occurs – Occur naturally as users enter, edit, and delete table data Named Data Macros – Can be accessed from anywhere in the database – Can accept parameters Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 18

Create a Named Data Macro Named Data Macro – Created and edited in table Design view – Save the macro with a descriptive name, such as DataMacro- – Can be run from within another macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 19

Create a Named Data Macro (continued) Figure Create a Named Data Macro Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 20 Create Data Macros Design view of the Contribution table Create Named Macro

Understand the Fundamentals of SQL Structured Query Language (SQL) – Industry standard language for defining, manipulating, and retrieving the data in a database – Developed at IBM by Donald Chamberlin and Raymond Boyce in the early 1970s – Used to create and modify tables – Microsoft’s own version of SQL for Microsoft Access Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 21

Interpret an SQL Select Statement SQL Select Statement – is used to retrieve data from the tables in a database SQL Keyword – defines the purpose and the structure of an SQL Statement Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 22

Interpret an SQL Select Statement (continued) Four basic SQL keywords: – SELECT - Instructs Access to return the specific fields from one or more tables – FROM - Specifies the table(s) that will be searched – WHERE - Specifies the criteria that records must match to be included in the results – ORDER BY - Is used to sort the records by a certain field in either ascending or descending order Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 23

Use an SQL Select Statement as a Record Source Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 24 Record source is an SQL statement FIGURE Contribution Report with SQL Record Source

Use an SQL Select Statement as a Record Source (continued) Basic structure of an SQL statement: SELECT field names FROM table name WHERE specified criteria must be met ORDER BY field name; Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 25

Use an SQL Select Statement as a Record Source (continued) Reasons for using an SQL statement for a record source: – Create a form or report without creating a new query – Easier to transfer a form or report to another database – Construct the record source of a report at run-time using VBA Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 26

Summary In this chapter, you learned how to use the following advanced techniques in Microsoft Access 2010: – Macros: to verify data entry and automate tasks – SQL statements: to create record sources Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 27

Questions Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 28

Copyright Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. 29 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.