Skip to main content

Access 2003 VBA Programmer's Reference

Access 2003 VBA Programmer's Reference

Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein

ISBN: 978-0-764-57166-4

Apr 2004

892 pages

Select type: E-Book

Product not available for purchase

Description

What is this book about?

Its power and short learning curve have made Access Microsoft’s leading consumer relational database management system for desktop applications. VBA lets you tap more of that power, responding to application level events, displaying forms and reports, manipulating toolbars, and much more.

In this book, a crack team of programmers, including two Microsoft MVPs, shows you how to take control of Access 2003 or 2002 using VBA. You’ll learn to create and name variables, use DAO and ADO to manipulate data, handle errors correctly, create classes and use APIs, and more. An entire chapter is devoted to the changes in Access 2003, including new wizards and GUI features that previously required VBA code as well as new VBA features.

You’ll receive a thorough education in system security, macro security, and the Access Developer Extensions (ADE). You will discover how to access data with VBA, execute and debug VBA code, and use VBA with Access objects. Finally, you will learn more about the relationship between Access and SQL Server, and how to use VBA in Access to control and enhance other Office applications.

What does this book cover?

Here are some of the things you'll discover in this book:

  • How to take advantage of the built-in Access object library, using Access commands and executing them from any Access toolbar
  • What you need to know to design your own classes, implement common APIs in your code, and use SQL to access data
  • How to configure custom menus for your Access database applications
  • Ways to transfer information between Access and Excel, Word, Outlook, and other Office programs
  • How to show or hide entire sections of reports based on data entered on a form, or hide form fields based on database login information
  • Object models you can use when writing VBA code in Access, and a list of common API functions to use in your code

Who is this book for?

This book is a comprehensive resource for Access users and VBA developers who want to increase the power of Access using VBA. In addition to experience with VBA, you should have read at least one tutorial covering VBA for Access.

Credits.

Title Page.

Copyright Page.

Dedication.

Acknowledgements.

Author Bios.

Introduction.

1. Intro to Access.

2. Access, VBA, and Macros.

3. New Features in 2003 (and 2002).

4. VBA Basics.

5. Using the VBA Editor.

6. Using DAO to Access Data.

7. Using ADO to Access Data.

8. Executing VBA.

9. VBA Error Handling.

10. Using VBA to Enhance Forms.

11. Enhancing Reports with VBA.

12. Creating Classes.

13. APIs.

14. SQL & VBA.

15. Working with Office Applications.

16. Security.

17. Understanding Client-Server Development with VBA.

18. Windows Registry.

19. Using the ADE Tools.

20. Macro Security.

Appendix A:  Upgrading to Access 2003.

Appendix B: References for Projects.

Appendix C: DAO Object Method and Property Descriptions.

Appendix D: ADO Object Model Reference.

Appendix E: Access Object Model.

Appendix F: Windows API Reference Information .

Appendix G: Naming Conventions.

Appendix H: VBA Reserved Words.

Appendix I: Tips and Tricks.

Appendix J: ADO Object Argument Information.

Appendix K: Access Wizards, Builders and Managers.

Appendix L: Windows Registry Information.

Index.

Code Downloads
Download the code and example databases for the book in .zip format.
Code downloads for this title are available here.
Code Downloads
Download
Download the code and example databases for the book in .zip format.
Code downloads for this title are available here.
Download
Download the code and example databases for the book in .ace format only 3/4 the size of the .zip.
Go to www.winace.com if your archive software doesn't support the .ace format.
Download
ChapterPageDetailsDatePrint Run
87Replacement 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