Microsoft Access 2003 Illustrated Complete

Slides:



Advertisements
Similar presentations
Integrated Business Applications with Databases (D3) Jenny Pedler
Advertisements

Using Macros and Visual Basic for Applications (VBA) with Excel
Tutorial 8: Developing an Excel Application
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Customisation The GUI in most GIS applications is sufficient for most needs. However, situations arise where you want either to: –Modify the interface,
Exploring Microsoft Access Chapter 8 Creating More Powerful Applications: Introduction to VBA By Robert T. Grauer Maryann Barber.
Microsoft Excel 2003 Illustrated Complete with Excel Programming.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Using the Visual Basic Editor Visual Basic for Applications 1.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Adding Automated Functionality to Office Applications.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
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.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
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.
Tutorial 11 Using and Writing Visual Basic for Applications Code
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.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
11 Chapter 10 Customizing a Database with Macros and Visual Basic for Applications Exploring Microsoft Office Access 2007.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Using Visual Basic for Applications (VBA) – Project 8.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Committed to Shaping the Next Generation of IT Experts. Chapter 10 Customizing a Database.
Visual Basic for Applications Macro Programming For Microsoft Office.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
OCC Network Drives  H:\  P:\ 
CHAPTER TWO INTRODUCTION TO VISUAL BASIC © Prepared By: Razif Razali 1.
Exploring Microsoft Access Chapter 8 Creating More Powerful Applications: Introduction to VBA.
Chapter 9 Macros And Visual Basic For Applications.
Access Lesson 11 Creating and Running Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
I Power Higher Computing Software Development Development Languages and Environments.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
Microsoft Excel Illustrated Programming with Excel.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 12 Introducing Visual Basic for Applications Microsoft Office Excel.
Exploring Excel Chapter 7 Automating Repetitive Tasks: Macros and
Chapter 2: The Visual Studio .NET Development Environment
Introduction to Programming and Visual Basic .NET
Microsoft Access Illustrated
Microsoft Office Illustrated
Microsoft Excel 2003 Illustrated Complete
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Computer Programming.
Exploring Microsoft Office Access 2007
DB Implementation: MS Access Macros
Exploring Microsoft Excel
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Tutorial 11 Using and Writing Visual Basic for Applications Code
Microsoft Excel 2007 – Level 2
Presentation transcript:

Microsoft Access 2003 Illustrated Complete Creating Modules and VBA

Objectives Understand modules and VBA Compare macros and modules Create functions Use If statements Creating Modules and VBA Unit O

Objectives Document procedures Create class modules Create sub procedures Troubleshoot modules Creating Modules and VBA Unit O

Understanding Modules A module is an Access object that stores Visual Basic for Applications (VBA) programming code VBA is written in the Visual Basic Editor Code window Two kinds of modules: Class module: contains VBA code stored in forms and reports Standard module: contains global code that can be executed from anywhere in the database Creating Modules and VBA Unit O

Understanding Modules A module contains VBA code organized in procedures A procedure is several lines of VBA code, each of which is called a statement A module may contain comments A procedure performs an operation or calculates an answer A function is a procedure that returns a value A sub (sub procedure) performs a series of VBA statements that manipulates an object or control Creating Modules and VBA Unit O

Understanding Modules In VBA, an object is any item that can be identified or manipulated A method is an action that an object can perform An event is a specific action that occurs on or to an object Creating Modules and VBA Unit O

Understanding Modules Object list Procedure list Declaration statements Project Explorer Window VBA code in Code window Creating Modules and VBA Unit O

Elements in the Visual Basic Code window Creating Modules and VBA Unit O

Comparing Macros and Modules Both macros and modules help run your database efficiently A macro is best suited to handle repetitive, simple tasks such as opening and closing forms Macros are generally easier to create because you don’t have to know any programming syntax To create a module, you must know a programming language, VBA Creating Modules and VBA Unit O

Comparing Macros and Modules You must use modules to create unique functions Use VBA procedures to detect Access errors VBA code stored in modules works with other Microsoft Office products Creating Modules and VBA Unit O

Common VBA keywords Creating Modules and VBA Unit O

Converting macros to Visual Basic Click the Macros button on the Objects bar, then click the name of the macro you want to convert If the macro is stored in a form or report, open the form or report in Design View, click the Tools menu, point to Macro, then click Convert Form’s (or Report’s) Macros to Visual Basic Creating Modules and VBA Unit O

Creating Functions Create a function to automate and simplify the unique calculations for your organization Create a new function in a standard module so that it can be used in any query, form, or report in the database Creating Modules and VBA Unit O

New function, EmployeePrice Creating Functions New function, EmployeePrice Creating Modules and VBA Unit O

Using IF Statements If…Then…Else logic allows you to test logical conditions and execute statements only if the conditions are true End the If…Then…Else structure with an End If statement Creating Modules and VBA Unit O

Using If Statements Creating Modules and VBA Unit O

Documenting Procedures Comment lines are statements in the code that document the code, and do not affect how the code runs Comment lines start with an apostrophe (‘) and are green in the Code window Creating Modules and VBA Unit O

Documenting Procedures Comment lines Creating Modules and VBA Unit O

Standard toolbar buttons in the Visual Basic window Creating Modules and VBA Unit O

Creating Class Modules Class modules are contained within forms and reports Equipment Entry Form CloseForm_Click() sub Creating Modules and VBA Unit O

Creating Sub Procedures If an event procedure, the name of the sub procedure contains the name of the object and event that triggers the code Form_DblClick() PrintButton_Click() Form_Current() Creating Modules and VBA Unit O

Creating Sub Procedures Form_DblClick PrintThisRecordButton_Click Creating Modules and VBA Unit O

Troubleshooting Modules Three types of errors. Compile-time errors: occur as a result of incorrectly constructed code Missing code or syntax error Run-time errors: occur after the code starts to run Include attempting an illegal operation Logic errors: occur when the code runs without problems, but the procedure doesn’t produce the desired result Hardest to troubleshoot Creating Modules and VBA Unit O

Troubleshooting Modules Use a breakpoint to stop code at a particular statement Creating Modules and VBA Unit O

Summary VBA stands for Visual Basic for Applications, the programming language that comes with Microsoft Office products Use VBA to create new functions and automate processes VBA is stored in standard and class modules Class modules are stored in forms and reports Creating Modules and VBA Unit O