Dedication | p. v |
Acknowledgments | p. xv |
Introduction | p. xvii |
Getting Started with Access VBA | p. 1 |
Introduction to VBA Programming in Access | p. 1 |
Understanding VBA Modules and Procedure Types | p. 1 |
Writing Procedures in a Standard Module | p. 4 |
Working in a Standard Module | p. 5 |
Executing Your Procedures | p. 7 |
Running Procedures and Functions | p. 7 |
Understanding Class Modules | p. 9 |
Events, Event Properties, and Event Procedures | p. 11 |
Why Use Events? | p. 12 |
Walking Through an Event Procedure | p. 12 |
Writing an Event Procedure | p. 13 |
Compiling Your Procedures | p. 18 |
Placing a Database in a Trusted Location | p. 18 |
Placing an Access Database in a Trusted Location | p. 19 |
Summary | p. 22 |
Getting to Know Visual Basic Editor (VBE) | p. 23 |
Understanding the Project Explorer Window | p. 23 |
Understanding the Properties Window | p. 25 |
Using the Properties Window to View Control Properties | p. 26 |
Understanding the Code Window | p. 27 |
Other Windows in the VBE | p. 29 |
Assigning a Name to the VBA Project | p. 30 |
Renaming the Module | p. 30 |
Syntax and Programming Assistance | p. 31 |
List Properties/Methods | p. 31 |
Parameter Info | p. 32 |
List Constants | p. 33 |
Quick Info | p. 34 |
Complete Word | p. 34 |
Indent/Outdent | p. 35 |
Using the Indent/Outdent Feature | p. 36 |
Comment Block/Uncomment Block | p. 36 |
Using the Object Browser | p. 36 |
Using the Object Browser | p. 38 |
Using the VBA Object Library | p. 39 |
Using Built-in VBA Functions | p. 39 |
Using the Immediate Window | p. 40 |
Experiments in the Immediate Window | p. 40 |
Asking Questions in the Immediate Window | p. 41 |
Summary | p. 42 |
Access VBA Fundamentals | p. 43 |
Introduction to Data Types | p. 43 |
Understanding and Using Variables | p. 46 |
Declaring Variables | p. 46 |
Using Variables | p. 48 |
Specifying the Data Type of a Variable | p. 50 |
Understanding the Data Tape of a Variable | p. 50 |
Using Type Declaration Characters | p. 51 |
Using Type Declaration Characters in Variable Names | p. 51 |
Assigning Values to Variables | p. 52 |
Assigning Values to Variables | p. 52 |
Forcing Declaration of Variables | p. 54 |
Forcing Declaration of Variables | p. 54 |
Understanding the Scope of Variables | p. 56 |
Procedure-Level (Local) Variables | p. 56 |
Module-Level Variables | p. 57 |
Understanding Module-Level Variables | p. 57 |
Project-Level Variables | p. 59 |
Understanding the Lifetime of Variables | p. 60 |
Using Temporary Variables | p. 60 |
Creating a Temporary Variable with a TempVars Collection Object | p. 61 |
Retriesing Names and Values of TempVar Objects | p. 61 |
Using Temporary Global Variables in Expressions | p. 62 |
Removing a Temporary Variable from a TempVars Collection Object | p. 62 |
Using Static Variables | p. 63 |
Using Static Variables | p. 63 |
Using Object Variables | p. 64 |
Working with Object Variables | p. 65 |
Disposing of Object Variables | p. 66 |
Finding a Variable Definition | p. 67 |
Finding a Variable Definition | p. 67 |
Determining the Data Type of a Variable | p. 67 |
Asking Questions about the Variable Type | p. 67 |
Using Constants in VBA Procedures | p. 68 |
Intrinsic Constants | p. 69 |
Exploring Access's Constants | p. 69 |
Using Intrinsic Constants in a VBA Procedure | p. 70 |
Summary | p. 71 |
Access VBA Built-in and Custom Functions | p. 73 |
Writing Function Procedures | p. 73 |
Writing a Function Procedure with Arguments | p. 73 |
Various Methods of Running Function Procedures | p. 74 |
Executing a Function Procedure from the Immediate Window | p. 74 |
Executing a Function Procedure from a Subroutine | p. 74 |
Specifying the Data Type for a Functions Result | p. 75 |
Calling a Function from a Procedure | p. 75 |
Passing Arguments By Reference and By Value | p. 77 |
Passing Arguments to Subroutines and Functions | p. 77 |
Using Optional Arguments | p. 78 |
Using Optional Arguments | p. 79 |
Using the is Missing Function | p. 80 |
Using VBA Built-in Functions for User Interaction | p. 80 |
Using the MsgBox Function | p. 81 |
Formatting the Message Box | p. 81 |
Using the MsgBox Function with Arguments | p. 86 |
Returning Values from the MsgBox Function | p. 88 |
Returning Values from the MsgBox function | p. 88 |
Using the Input Box Function | p. 89 |
Using the InputBox Function | p. 90 |
Converting Data Types | p. 91 |
Converting Data Types | p. 92 |
Summary | p. 93 |
Adding Decisions to Your Access VBA Programs | p. 95 |
Relational and Logical Operators | p. 95 |
If…Then Statement | p. 96 |
Using the If… Then Statement | p. 96 |
Multiline If…Then Statement | p. 98 |
Using the Multiline If… Then Statement | p. 98 |
Decisions Based on More Than One Condition | p. 99 |
Using the If…Then…AND Statement | p. 100 |
If…Then…Else Statement | p. 101 |
Using the If…Then…Else Statement | p. 102 |
If…Then…Elself Statement | p. 103 |
Nested If…Then Statements | p. 103 |
Using Nested If…Then Statements | p. 104 |
Select Case Statement | p. 106 |
Using the Select Case Statement | p. 107 |
Using Is with tire Case Clause | p. 108 |
Specifying a Range of" Values in a Case Clause | p. 109 |
Using the Select Case Statement in a Function | p. 110 |
Specifying Multiple Expressions in a Case Clause | p. 111 |
Summary | p. 111 |
Adding Repeating Actions to Your Access VBA Programs | p. 113 |
Using the Do…While Statement | p. 113 |
Using the Do…While Statement | p. 114 |
Another Approach to the Do… While Statement | p. 115 |
Using the Do…While Statement with a Condition at the Bottom of the Loop | p. 115 |
Using the Do…Until Statement | p. 116 |
Using the Do… Until Statement | p. 117 |
Another Approach to the Do… Until Statement | p. 117 |
Using the Do… Until Statement with a Condition at the Bottom of the Loop | p. 118 |
Using the For…Next Statement | p. 118 |
Using the For… Next Statement | p. 119 |
Using the For Each…Next Statement | p. 121 |
Using the For Each…Next Statement | p. 121 |
Exiting Loops Early | p. 122 |
Early Exit from a Loop | p. 122 |
Nested Loops | p. 123 |
Using Nested Loops | p. 123 |
Summary | p. 124 |
Keeping Track of Multiple Values Using Arrays | p. 125 |
Understanding Arrays | p. 125 |
Declaring Arrays | p. 127 |
Array Upper and Lower Bounds | p. 129 |
Initializing and Filling an Array | p. 129 |
Filling an Array Using Individual Assignment Statements | p. 129 |
Filling an Array Using the Array Function | p. 130 |
Filling an Array Using For…Next Loop | p. 130 |
Using a One-Dimensional Array | p. 131 |
Using a One-Dimensional Army | p. 131 |
Arrays and Looping Statements | p. 132 |
Using the For Each…Next Statement to List the Army Elements | p. 133 |
Pasting Elements of an Array to Another Procedure | p. 133 |
Using Arrays and Loops in Real Life | p. 134 |
Using a Two-Dimensional Array | p. 136 |
Using a Two-Dimensional Array | p. 136 |
Static and Dynamic Arrays | p. 137 |
Using a Dynamic Array | p. 137 |
Array Functions | p. 139 |
The Array Function | p. 139 |
Using the Array Function | p. 139 |
The Is Array Function | p. 139 |
Using the IsArray Function | p. 139 |
The Erase Function | p. 140 |
Removing Data from an Array | p. 140 |
The LBound and UBound Functions | p. 141 |
Finding the Lower and Upper Bounds of an Array | p. 141 |
Errors in Arrays | p. 142 |
Understanding Errors in Arrays | p. 143 |
Parameter Arrays | p. 144 |
Working with Parameter Arrays | p. 145 |
Passing Arrays to Function Procedures | p. 145 |
Passing an Array to a Function Procedure | p. 145 |
Sorting an Array | p. 146 |
Sorting an Array | p. 147 |
Summary | p. 148 |
Keeping Track of Multiple Values Using Object Collections | p. 149 |
Working with Collections of Objects | p. 150 |
Declaring a Custom Collection | p. 151 |
Adding Objects to a Custom Collection | p. 151 |
Creating a Custom Collection | p. 152 |
Removing Objects from a Custom Collection | p. 153 |
Removing Objects from a Collection | p. 153 |
Creating Custom Objects in Class Modules | p. 153 |
Creating a Class | p. 154 |
Custom Project 8.1. (Step 1) Creating a Class Module | p. 154 |
Valuable Declarations | p. 155 |
Custom Project 8.1. (Step 2) Declaring Class Members | p. 155 |
Defining the Properties for the Class | p. 156 |
Creating the Property Get Procedures | p. 157 |
Custom Project 8.1. (Step 3) Meriting Property Gel Procedures | p. 157 |
Creating the Property Let Procedures | p. 158 |
Custom Project 8.1. (Step 4) Writing Property Let Procedures | p. 158 |
Creating the Class Methods | p. 159 |
Custom Project 8.1. (Step 5) Writing Class Methods | p. 159 |
Creating an Instance of a Class | p. 160 |
Custom Project 8.1. (Step 6) Creating an Instance of a Class | p. 161 |
Event Procedures in the Class Module | p. 161 |
Creating the User Interlace | p. 162 |
Custom Project 8.1. (Step 7) Designing a User Form | p. 162 |
Custom Project 8.1. (Step 8) Writing Event Procedures | p. 164 |
Running the Custom Application | p. 171 |
Custom Project 8.1. (Step 9) Running the Custom Project | p. 171 |
Watching the Execution of Your VBA Procedures | p. 171 |
Custom Project 8.1. (Step 10) Custom Project Code Walkthrough | p. 172 |
Summary | p. 174 |
Getting to Know Built-in Tools for Testing and Debugging | p. 175 |
Stopping a Procedure | p. 176 |
Using Breakpoints | p. 177 |
Custom Project 9.1. Debugging a Function Procedure | p. 178 |
Removing Breakpoints | p. 182 |
Using the Immediate Window in Break Mode | p. 182 |
Using the Stop Statement | p. 184 |
Using the Assert Statement | p. 185 |
Using the Add Watch Window | p. 186 |
Watching the Values of VBA Expressions | p. 187 |
Removing Watch Expressions | p. 189 |
Using Quick Watch | p. 189 |
Using the Quick Watch- Dialog Box | p. 190 |
Using the Locals Window | p. 190 |
Using the Locals Window | p. 191 |
Using the Call Stack Dialog Box | p. 191 |
Stepping Through VBA Procedures | p. 192 |
Stepping Through a Procedure | p. 193 |
Stepping Over a Procedure | p. 194 |
Stepping Over a Procedure | p. 194 |
Stepping Out of a Procedure | p. 195 |
Running a Procedure to Cursor | p. 195 |
Setting the Next Statement | p. 195 |
Showing the Next Statement | p. 196 |
Navigating with Bookmarks | p. 196 |
Stopping and Resetting VBA Procedures | p. 197 |
Trapping Errors | p. 197 |
Using the Err Object | p. 198 |
Error Trapping Techniques | p. 199 |
Procedure Testing | p. 202 |
Setting Error Trapping Options | p. 203 |
Summary | p. 204 |
Index | p. 205 |
Table of Contents provided by Ingram. All Rights Reserved. |