WILEY

KNOWLEDGE FOR GENERATIONS

WILEY - KNOWLEDGE FOR GENERATIONS

United States Change Location

cart.gif CART |  MY ACCOUNT |  CONTACT US |  HELP    
Cover image for product 0764559036
Access 2003 VBA Programmer's Reference
ISBN: 978-0-7645-5903-7
Paperback
984 pages
April 2004
US $39.99 Add to Cart

This price is valid for United States. Change location to view local pricing and availability.

Other Available Formats: Adobe E-Book
  • Description
  • Table of Contents
  • Author Information
  • Errata
  • Download

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
87 Replacement Code
At the bottom of page, last 2 sentences: should be: The following code sample illustrates how both the declaration and it’s location affect a variable’s scope and lifetime.
Option Explicit 'Used to require variable declaration

Public txtCustomerName as String 'Scope is entire application
Private txtVendor as String 'Scope is any procedure in this module
Dim txtSupplier as String 'Scope is the current module


Private Sub GetCustomerName()
Dim txtCustomer as String 'Scope is limited to this sub
End Sub
You might be wondering why the two statements that begin with Dim have different scopes. Use of the Dim keyword in the General Declarations section sets the scope of the variable to the module, so it can be used by any procedure in that module.. In the previous listing, txtVendor and txtSupplier are both module-level variables. They can be used anywhere within the module and anytime the module is loaded. txtCustomerName is a global variable. It can be used anywhere within any procedure in the application.
01/03/07