Skip to main content

Beginning Access 2000 VBA

Beginning Access 2000 VBA

Robert Smith, Dave Sussman

ISBN: 978-0-764-54383-8

Apr 2000

896 pages

Select type: Paperback

Product not available for purchase


What is this book about?

Access 2000 is an important part of the Office 2000 program suite, and is available on both the Premium and Professional editions of Office 2000. Access has traditionally been the Office suite database program par excellence. It still remains that way, but with Office 2000 the face of Access is changing. This book will look at the traditional role of Access and its future uses in the Office suite.

Using VBA (Visual Basic for Applications), the user can program his or her own programs in what is essentially a subset of the Visual Basic programming languages. This is tremendously powerful, as it allows you to create great User Interfaces (forms etc), as a front end to actual database storage and manipulation. This continues to be one of the great strengths of programming Access VBA.

This book updates, expands and improves Beginning Access 97 VBA Programming, in an Office 2000 setting. All the great tutorial content, teaching people how to program with VBA in Access is there, but now majorly rewritten to take account of Office 2000.

  • Updated to take account of the Office 2000 facilities
  • Constructs a substantial example application with VBA
  • Database theory taught in the Wrox Beginning style

What does this book cover?

In this book, you will learn how to

  • Construct a substantial example application with VBA
  • Master the foundations of Visual Basic for Applications
  • Understand the concepts behind classes and objects
  • Understand how Automation can be used to link Office applications
  • Create custom objects using the Class Module feature
  • Debug your programs and implement robust error handling
  • Add support for multiple users
  • Publish your Access database on the Internet
  • Optimize and add polish to your finished database application

Who is this book for?

This book is for users who already have a basic knowledge of databases and the basic Access objects, such as tables, queries, forms and reports. You now want to expand on your existing knowledge of Access and wish to learn how to program in VBA. You don't need any prior programming experience, although a basic knowledge of Access macros would be helpful.


Chapter 1. Access 2000 – A Long Journey.

Chapter 2. Designing Applications.

Chapter 3. Introduction to Event Driven Programming.

Chapter 4. Creating Code.

Chapter 5. Controlling the Program.

Chapter 6. Using Access Objects.

Chapter 7. Using DAO.

Chapter 8. Data Management Techniques.

Chapter 9. External Data.

Chapter 10. Reports.

Chapter 11. Advanced Programming Techniques.

Chapter 12. Error Handling and Debugging.

Chapter 13. Using Classes.

Chapter 14. Libraries and Add-Ins.

Chapter 15. Automation.

Chapter 16. Multi-User.

Chapter 17. The Internet.

Chapter 18. Optimizing Your Application.

Exercise Solutions.

Appendix A. Choosing Between MSDE and Jet.

Appendix B. Choosing Between DAO and ADO.

Appendix C. ADO 2.1 Object Model.

Appendix D. Access Object Model.

Appendix E. Microsoft DAO 3.6 Object Library Reference.

Appendix F. Access Events.

Appendix G. ANSI Character Set.

Appendix H. ODBC and PWS. file is in this zip file (we left it off the CD - sorry!)Download
Excercise SolutionsDownload
ChapterPageDetailsDatePrint Run
WileyError in loading dll for main project ,

In the database icecream.mdb in the root directory of the installation for
the book's files, most readers will see the message Error in loading dll .
It happens when trying to go into the VBE, when trying to close Access 2000,
and at some other times. If the References dialog is opened from the Tools menu in the VBE, the following entry will be seen: MISSING: Microsoft
ActiveX Data Objects 2.1 Library . This will occur even though the path to
msado15.dll will be correct. This is due to a glitch in the references for
this particular project. To correct this, in the References dialog,
deselect the Missing entry and click OK to apply the deletion. Then, open
the References dialog again, and scroll down to Microsoft ActiveX Data
Objects 2.1 Library. Select it, click OK to apply the selection, then save
the database. You shouldn't see the error any longer.

Note that this doesn't occur on any of the other databases for the book.

Submitted by: David Liske
Tech Reviewer, Beginning Access 2000 VBA

79Page 79 Typing error ,

The second exercise should include the phrase 'event handlers' rather than 'even handlers'. The whole paragraph should read:

Take some time to read through the list of events and their uses. You will find that some events are more useful than others - in other words, you will find yourself writing custom event handlers for some events more often than for other events. Look at the list and try to think about which events you would most commonly handle with custom event handlers.

Thanks to Heather Wainwright

90Page 90 IsMissing function ,

The code at the bottom of the page has two unnecessary Else statements. It should simply read as follows:

Function MakeIceCream(Optional CocoaToBeAdded As Variant, _
Optional VanillaToBeAdded As Variant) As String

If IsMissing(CocoaToBeAdded) Then
CocoaToBeAdded = True
End If

If IsMissing(VanillaToBeAdded) Then
VanillaToBeAdded = True
End If

Thanks to Chris Kennedy

102Page 102 Table at bottom of page ,

In the table at the foot of this page the third value given in the left-hand column should read '22.345' rather than '12.345 + 10 ' as stated.

Thanks to Terry Franklin

106Page 106 Code Error ,

The code in bullet 2 should read:

Sub DateTest()
Dim datDec As Date
Dim datMay As Date

datMay = #5/1/1998#
datDec = #12/1/1998#

Debug.Print DatePart( m , datDec)
Debug.Print DateDiff( m , datMay, datDec)

Debug.Print August is & DateAdd( m , 3, datMay)
End Sub

Thanks to Michael Payne

116Page 116 Error in Code ,

n step 3 the line

Option Explicit

should be included in the General Declarations section.
Also the subroutine TestLocal should be declared as Public rather than Private. The code should then look like this:

Public Sub TestLocal()

Thanks to Charles E. Brown

116Step 1 Code Highlight ,

Step 1 should have the following lines highlighted:

    Dim intVariable1 As Integer
    Dim intVariable2 As Integer

    intVariable1 = 1