Acknowledgments Introduction. Chapter 1: Introduction to Access 2007 VBA 1. The Visual Basic Editor 18. Testing Phase 24

Similar documents
Excel Programming with VBA (Macro Programming) 24 hours Getting Started

Acknowledgments Introduction. Part I: Programming Access Applications 1. Chapter 1: Overview of Programming for Access 3

What's New in Access 2000 p. 1 A Brief Access History p. 2 Access the Best Access Ever p. 5 Microsoft Office Developer Features p.

BASIC EXCEL SYLLABUS Section 1: Getting Started Section 2: Working with Worksheet Section 3: Administration Section 4: Data Handling & Manipulation

Excel 2016: Introduction to VBA

Contents. More Controls 51. Visual Basic 1. Introduction to. xiii. Modify the Project 30. Print the Project Documentation 35

SAP' ABAP. Handbook. Kogent Learning Solutions, Inc. Sudbury, Massachusetts JONES AND BARTLETT PUBLISHERS BOSTON TORONTO LONDON SINUAPORI:

Visual Basic 6 (VB6 Comprehensive) Course Overview

Microsoft Visual Studio 2010

Introduction... 1 Part I: Getting Started with Excel VBA Programming Part II: How VBA Works with Excel... 31

CHAPTER 1: INTRODUCING C# 3

MS Excel VBA Class Goals

Acknowledgments. Chapter 1: Primer in Excel VBA 1. Chapter 2: The Application Object 63

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Welcome to SQL Server Integration Services 1. Chapter 2: The SSIS Tools 21

Advance Excel Performing calculations on data 1. Naming groups of data 2. Creating formulas to calculate values

ADVANCED EXCEL Course Modules for Advance Excel Training Online (MS Excel 2013 Course):

"Charting the Course... SharePoint 2007 Hands-On Labs Course Summary

COURSE CONTENT Excel with VBA Training

Installing and Administering a Satellite Environment

"Charting the Course to Your Success!" MOC D Querying Microsoft SQL Server Course Summary

Microsoft Visual Basic for Applications

EXPERT TRAINING PROGRAM [QTP/ALM]

C# Programming: From Problem Analysis to Program Design. Fourth Edition

Coding Faster: Getting More Productive with Microsoft Visual

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing T-SQL and Data Management Systems 1. Chapter 2: SQL Server Fundamentals 23.

Free Downloads Automating Microsoft Access With VBA

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

What s New in Access Learning the history of Access changes. Understanding what s new in Access 2002

CHAPTER 1: INTRODUCTION TO THE IDE 3

Scenario Manager User Guide. Release September 2013

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Work more efficiently by learning how to automate recurring tasks and create user applications

Microsoft Access 2010

About the Author... xiii Introduction... xiv Acknowledgments and Thanks... xv Terminology... xvii Sample Code... xvii

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

Murach s Beginning Java with Eclipse

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Microsoft Certified Application Specialist Exam Objectives Map

Oracle Data Integrator: Administration and Development Volume I Student Guide

Microsoft. Microsoft Visual C# Step by Step. John Sharp

From Access to SQL Server

Contents. Excel 2013 Workbook... 1 Starting Excel The Startup Screen... 3 The Excel Screen... 4 Quick Access Toolbar...

"Charting the Course... MOC C: Developing SQL Databases. Course Summary

Table of Contents. Introduction... xxi

Acknowledgments Introduction to Database Systems p. 1 Objectives p. 1 Functions of a Database p. 1 Database Management System p.

Contents I Introduction 1 Introduction to PL/SQL iii

Beginning ASP.NET. 4.5 in C# Matthew MacDonald

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Table of Contents COPYRIGHTED MATERIAL. Introduction Book I: Excel Basics Chapter 1: The Excel 2013 User Experience...

Access ComprehGnsiwG. Shelley Gaskin, Carolyn McLellan, and. Nancy Graviett. with Microsoft

Contents. Acknowledgments

Learning C# 3.0. Jesse Liberty and Brian MacDonald O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo

COWLEY COLLEGE & Area Vocational Technical School

Learn Windows PowerShell 3 in a Month of Lunches

Microsoft Access 2013/2016 Course Outlines (version differences will be noted in the outline).

Integration Services. Creating an ETL Solution with SSIS. Module Overview. Introduction to ETL with SSIS Implementing Data Flow

Proje D2K. CMM (Capability Maturity Model) level Project Standard:- Corporate Trainer s Profile

Chapters and Appendix F are PDF documents posted online at the book s Companion Website (located at

object/relational persistence What is persistence? 5

About the Authors. Preface

Document Management System. for QC Postfunding Review

COPYRIGHTED MATERIAL. Contents at a Glance

AVANTUS TRAINING PTE LTD

"Charting the Course... Intermediate PHP & MySQL Course Summary

Introduction to PTC Windchill PDMLink 11.0 for Heavy Users

Pro SharePoint 2010 Administration

Opening From Web Server 1-14 Appending Files 1-14 Merging Files 1-15 Scene Statistics 1-16

Oracle Data Integrator 11g: Integration and Administration Student Guide - Volume I

Mastering phpmyadmiri 3.4 for

1.8.1 Research various database careers SE: 335

Prentice Hall CBT Systems X In A Box IT Courses

SE: 4, 6, 31 (Knowledge Check), 60, (Knowledge Check) 1.2 Explain the purpose of a relational Explain how a database is

Pro Business Applications with Silverlight 4

Installing SharePoint Server 2007

Lesson 1: Hello ios! 1

"Charting the Course... Oracle18c SQL (5 Day) Course Summary

Forms 10g. Section Title Page

Access VBA LinkedIn Introduces object oriented programming and provides a foundation in the Access object model and the Visual Basic for Applications

COPYRIGHTED MATERIAL. Contents. Part One: Team Architect 1. Chapter 1: Introducing the Visual Designers 3

ffi rs.indd 10/07/2015 Page i Access 2016 Bible

Visual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB

A Web-Based Introduction

Access 2016 Essentials Syllabus

Respond to Errors and Unexpected Conditions

Wind River Workbench (VxWorks Version) User's Guide, 3.0. Wind River Workbench USER S GUIDE 3.0. VxWorks Version

Contents. Illustrations. 1 Introduction to Computers, the Internet, the Web and C# 1

Introduction to PTC Windchill PDMLink 11.0 for the Implementation Team

CSC 330 Object-Oriented

"Charting the Course... Java Programming Language. Course Summary

James Foxall. Sams Teach Yourself. Visual Basic 2012 *24. Hours. sams. 800 East 96th Street, Indianapolis, Indiana, USA

COPYRIGHTED MATERIAL. Contents

Debugging Code in Access 2002

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

The 4D Web Companion. David Adams

Fundamentals of the Java Programming Language

Introduction... xxxi Chapter 1: Introducing SQL Server In Depth... 2

Chapter 1: Introducing SQL Server

Contents Introduction 1

foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration

Transcription:

Acknowledgments Introduction Chapter 1: Introduction to Access 2007 VBA 1 What Is Access 2007 VBA? 1 What s New in Access 2007 VBA? 2 Access 2007 VBA Programming 101 3 Requirements-Gathering Phase 3 Design Phase 4 Model the Application Design 4 Determine Application Architecture 11 Development Phase 18 The Visual Basic Editor 18 Testing Phase 24 Running and Debugging Code in the Visual Basic Editor 24 Implementation Phase 25 Summary 25 Exercises 26 Chapter 2: The Basics of Writing and Testing VBA Code 27 Creating Modules 27 Standard Modules versus Class Modules 29 Creating and Calling Procedures 33 Sub versus Function Procedure 33 Create and Call a New Sub Procedure 33 Create and Call a New Function Procedure 42 Scope and Lifetime of Sub Procedures and Functions 45 Using Built-In Functions 45 Macros versus Procedures 46 Using Variables and Constants to Store Values 49 Types of Variables 49 Declaring and Using Variables 51 Declaring and Using Arrays 51 COPYRIGHTED MATERIAL ix xix

Constants 53 Declaring and Using Constants 53 Using Built-In Constants 54 Scope and Lifetime of Variables and Constants 54 Naming Conventions 55 Controlling Program Flow 56 Decision Making 56 If...Then 56 IIf 59 Conditional If 59 Select... Case 59 Loops 61 For... Next and For Each... Next 61 Do... Loop 62 While... Wend 63 Documenting Your Code 63 Error Debugging 64 Types of Errors 64 Syntax Errors 64 Compile Errors 64 Runtime Errors 64 Logic Errors 66 Debugging Your Code 66 Using Breakpoints to Step through Code 66 Using the Immediate Window 68 Using the Locals Window 68 Using the Watch Window 69 Using the Call Stack 70 Error Handling 71 Default Error Messages 72 Handling Errors with an On Error Statement 72 On Error Statement 72 Resume Statement 72 The Err Object 74 Raising an Error 74 Using the Errors Collection 75 Creating a Generic Error Handler 75 Summary 78 Exercises 78 xii

Chapter 3: Programming Applications Using Objects 79 Elements of an Object 79 What Is a Property? 80 What Is a Method? 82 What Is an Event? 84 Viewing Objects Using the Object Browser 91 Ways to Refer to Objects 93 Using Access Collections and Objects 94 The Forms Collection and Form Object 94 The Reports Collection and Report Object 96 The CurrentProject Object 97 The DoCmd Object 97 The Screen Object 98 The Printers Collection and Printer Object 98 Other Objects 100 Summary 100 Exercises 100 Chapter 4: Creating Your Own Objects 101 Using Class Modules to Create Your Own Objects 101 Class Diagrams 102 Creating Properties 105 Using Public Variables 105 Using Property Let, Property Get, and Property Set 106 Creating Methods 111 Using Public Sub Procedures and Functions 111 Creating Events 113 Declaring and Raising Events 114 Creating the Event Sub Procedure or Function 114 Using the Class 115 Instantiating the Class 115 Initialize and Terminate Events 115 Advanced Techniques 121 Creating Multiple Instances of the Class 121 Creating Class Hierarchies 122 Working with Enumerated Types 122 Inheritance Using Implements Keyword 123 xiii

Create Custom Properties for Existing Objects 124 Using Existing Tag Property 124 Using Public Variables 124 Using Property Let, Property Get, and Property Set Routines 124 Create Custom Methods for Existing Objects 125 Using Public Sub Procedures and Functions 126 Summary 127 Exercises 127 Chapter 5: Interacting with Data Using ADO and SQL 129 Introduction to Data Access 129 Using ADODB to Work with Data 130 The ADO Object Model 130 The Connection Object 131 Connecting to Access Databases 132 Connecting to Other Databases 132 The Command Object 132 The Recordset Object 132 Creating a Recordset 133 Counting Records in a Recordset 140 Navigating through a Recordset 141 Adding, Editing, and Deleting Records in a Recordset 141 Sorting, Finding, and Filtering Records in a Recordset 156 Introduction to SQL 159 Retrieving Data Using SQL Select Statements 160 Select Clause 160 From Clause 160 Where Clause 161 Order By Clause 161 Subqueries 162 Union 162 Using SQL and ADO to Populate a Recordset 162 Inserting Data Using SQL Insert Statements 164 Inserting Results of a Select into a Table 165 Updating Data Using SQL Statements 165 Deleting Data Using SQL Statements 165 xiv

Using ADOX to Manipulate Data Objects 177 Creating a Table with ADOX 177 Summary 179 Exercises 179 Chapter 6: Building Interactive Forms 181 Form Navigation and Flow 181 Working with Controls 187 Combo Boxes versus List Boxes 188 Tab Controls and Subforms 193 Building User Interaction 195 The MsgBox Function 195 Validating User Input 196 Adding Polish to Your Forms 197 Summary 198 Exercises 198 Chapter 7: Importing, Linking, and Exporting Using External Data Sources 199 Linking, Importing, and Exporting Overview 200 Access and Other Databases 200 Transferring Complete SQL Server Database 203 Spreadsheets 204 Text Files 205 XML Files 208 E-mails and Outlook 210 Other Ways to Export Data 211 Summary 211 Exercises 212 Chapter 8: Using Access with Web Services and SharePoint Lists 213 Introduction to Web Services 214 Using Data from Web Services 214 Introduction to SharePoint Lists 221 Using Data from SharePoint Lists 222 Linking and Importing SharePoint Lists 222 Summary 232 Exercises 233 xv

Chapter 9: Creating Reports and Web-Enabled Output 235 Working with Reports from VBA 235 Setting the Report Data Source 236 Creating Reports Programmatically 237 Creating an Empty Report 238 Adding Controls to the Report 238 Using the Printer Object to Designate Printing Options 246 Working with Report Events 247 Exporting Access Data to Web Formats 248 Creating Static HTML Pages 249 Summary 251 Exercises 251 Chapter 10: Building SQL Server Applications with Access Projects 253 Access Projects Using Access as a Front End to SQL server 253 Setting Up SQL Server 254 SQL Server Versions 255 Obtaining and Installing SQL Server Express Engine 255 The Benefits of SQL Server Express Edition 256 Installing SQL Server Express Edition 256 Understanding What Was Installed 257 Creating Access Projects (ADPs) 259 Using an Existing SQL Server Database 260 Using a New SQL Server Database 262 Working with SQL Server Objects from Access 264 SQL Server Tables 264 SQL Server Stored Procedures 267 SQL Server Views 271 SQL Server Functions 275 Migrating an Existing Access Database to an Access Project 277 Changes to an Existing Database 277 Using the Upsizing Wizard 277 Summary 285 Exercises 285 Chapter 11: Advanced Access Programming 287 Using Dynamic Link Libraries (DLLs) 287 Standard DLLs 287 Using External DLLs 291 xvi

Automation 294 Working with Automation Objects 294 Controlling Microsoft Excel 295 Controlling Microsoft Word 298 Controlling Microsoft Outlook 302 ActiveX Controls 305 Libraries 308 Add-Ins 312 Transactions 313 Summary 314 Exercises 314 Chapter 12: Finishing the Application 315 Multiuser Considerations 315 Record Locking and Update Conflicts 316 Record Locking on Bound Forms 316 Record Locking on Unbound Forms 317 Multiuser Architecture Considerations 318 Optimizing Your Applications 322 Improving Actual Performance 322 General Design Guidelines 322 Optimizing VBA Code 323 Improving Data Access 324 Improving Perceived Performance 325 Running the Performance Analyzer 326 Securing Your Application 327 Adding a Database Password 327 Adding a Password for VBA Code 328 Encrypting a Database 329 Distributing Your Application 329 Distributing the Application to Users with the Full Version of Access 330 Distributing the Application with the Access Runtime 330 Distributing an Execute-Only Application 331 Maintaining the Application 331 Compacting and Repairing the Database 331 Making Backup Copies of the Database 331 Summary 332 Exercises 332 xvii

Chapter 13: Case Study 1: Project Tracker Application 333 Design Specifications 334 Building the Database 340 Building the User Interface 344 Building the Class Modules for the Objects 357 The Project Class 358 The Contact Class 372 Building the Standard Modules 383 Connecting the User Interface to the Code 410 The Projects Form 410 The Contacts Form 440 Touring the Finished Project Tracker Application 452 Summary 459 Chapter 14: Case Study 2: Customer Service Application 461 Design Specifications 461 Building the Database and Database Objects 465 Building the User Interface 475 Building the Class Module for the Objects 481 Building the Standard Modules 488 Connecting the User Interface to the Code 499 The Customer Search Form 500 The View/Manage Customer Accounts Form 504 Touring the Finished Customer Service Application 512 Summary 518 Appendix A: Exercise Answers 519 Index 527 xviii