Wiley.com
Get technical support for this product Print this page Share

Beginning Access 2000 VBA

ISBN: 978-0-7645-4383-8
Paperback
896 pages
April 2000
Beginning Access 2000 VBA (0764543830) cover image
This title is out-of-print and not currently available for purchase from this site.

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
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

19-Nov-99 1
79 Page 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

22-Feb-01 1
90 Page 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

26-Jul-01 1
102 Page 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

24-Jul-01 1
106 Page 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

22-Feb-01 1
116 Page 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()
Procedure1
Procedure2
Procedure1



Thanks to Charles E. Brown

22-Feb-01 1
116 Step 1 Code Highlight

Step 1 should have the following lines highlighted:


    Dim intVariable1 As Integer
    Dim intVariable2 As Integer

    intVariable1 = 1
    intVariable2 = 2

    Debug.Print intVariable1
    Debug.Print intVariable 2

07-Oct-02 1
187 Code Error
19-Jul-02We have just found an error in the code supplied in the Solutions.mdb database pertaining to the exercise in Chapter 6, pg 187. Thanks to Roger Pellatt
The original code snippet:

        For Each ctlControl In objAO.Controls
                ctlControl.FontName = strFont
        Next

should read:

         For Each ctlControl In Forms(objAO.Name).Controls
                ctlControl.FontName = strFont
         Next
19-Jul-02 1
198 Page 198 typo

The last line of code at the bottom of the page should read as:

?CurrentDB().Name


Thanks to W.Xie

18-Jul-01 1
205 Page 205 Table-type Recordset Objects

The following statement is incorrect:

"This is the default type for any Recordset objects where the records come
from a single local or attached Access tables."

It should read as:

"This is the default type for any Recordset objects where the records come from a single local Access table."


Many thanks to Mike MacSween

20-Mar-01 1
228 Page 228 Error in Code

Code should read as:

Sub FindByPrice(curPrice As Currency)

Dim db As Database
Dim rec As Recordset
Dim strSQL As String
Dim strMatches As String
Dim intCounter As Integer

strSQL = "tblSales"

Set db = CurrentDb()
Set rec = db.OpenRecordset(strSQL, dbOpenSnapshot)

rec.FindFirst "AmountPaid = " & curPrice
Do While rec.NoMatch = False
intCounter = intCounter + 1
strMatches = strMatches & Chr$(10) & rec("SalesID")
rec.FindNext "AmountPaid = " & curPrice
Loop

Select Case intCounter
Case 0
MsgBox "No orders cost " & FormatCurrency(curPrice)
Case 1
MsgBox "The following order cost " & _
FormatCurrency(curPrice) & " : " & _
Chr$(10) & strMatches
Case Else
MsgBox "The following " & intCounter & " orders cost " & _
FormatCurrency(curPrice) & " : " & _
Chr$(10) & strMatches
End Select

rec.Close

End Sub





Thanks to Richard Giambrone

22-Feb-01 1
271 Page 271 code error

In bullet point 4 at the bottom of the page the Function declaration should read as:

Function BuildResultsTable(strSQL As String, _
strTableName As String, _
lngRecordsAffected As Long) As Boolean


Thanks to W.Xie

18-Jul-01 1
336 Page 336 Code Error

n section 13 at the bottom of the page the code should read as follows:

txtValue = ""

With m_rptSales
.Filter = ""
.FilterOn = False
.txtFilter.Visible = False
.lblFilter.Visible = False
End With



Thanks to Michael Payne

22-Feb-01 1
374 Page 374 Missing code

The code in point 3 at the top of the page should read as follows:

Dim prpCriteria As Property
Dim intWHEREPos As Integer
Dim tdf As TableDef

In addition, the first four lines of highlighted code in point 4 should read as:

'Now add a custom property to the table to hold the criteria
db.TableDefs.Refresh
Set tdf = db.TableDefs(sTableName)
Set prpCriteria = tdf.CreateProperty("Criteria")

18-Jul-01 1
444 Typo

On the botton of page 444 says


       
Set clsRect = Nothing

it should be

Set objRect = Nothing
17-Jun-02 1
471 Page 471 The MeanDelay property

n point 5 the first line should read:

Public Property Get MeanDelay() As Double

and not
Public Property Get MeanDelay() As Integer



Thanks to Gordon Wilmot

23-Feb-01 1
540 Order.dot missing from CD

It appears the Order.dot template you need to run the "Creating a Word Document" Try It Out in Chapter 15 was omitted from the CD. We have added it to the code download section for the book on this site. Apologies if this caused any inconvenience.

Peter Morgan

03-Aug-99 1
541 Incorrect code

At the bottom of page 540, two variables are declared as follows:
Private Const m_strDIR As String = ???C:\BegVBA\???
Private Const m_strTEMPLATE As String = ??? Order.dot???
However, the CreateOrderLetter code at the top of page 541 shows a variable that is not declared, g_strTEMPLATE:
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & g_strTEMPLATE)
The variable g_strTEMPLATE at the top of page 541 needs to be changed to m_strTEMPLATE, as in:
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)
This is also how this variable is used in the code in IceCream15.mdb, which works correctly.
Submitted by: Pat Eisner
ZDU/SmartPlanet Student

***Note that the same errata occured on page 544 (bottom line) and page 545 (half-way down the page).

22-Nov-99 1
552 Page 552 Code error

THe SELECT statement in the code snippet on this page should read as:

Else
strSQL = "SELECT * FROM qryxSalesSummary WHERE CompanyName=""" & _
cboCompany.Column(1) & """"

20-Mar-01 1
557 Page 557 Code snippet

The SELECT statement towards the bottom of the page should read as follows:


Else
strSQL = "SELECT * FROM qryxSalesSummary WHERE CompanyName=""" & _
cboCompany.Column(1) & """"

12-Apr-01 1
594 Page 594 Coding error

The portion of code that verifies the new password does not exit the
function if the check fails, but carries on and changes the password
anyway. The code segment at the the top of page 594 should read:

If strNew <> strVerify Then
MsgBox "Your new password and the verification of your " & _
"new password do not match. " & _
vbCrLf & vbCrLf & _
"Please try again.", vbExclamation
GoTo ChangePassword_Exit


Thanks to Gordon Clark

24-Jul-01 1
687 Error in code

Dave Sussman comments....

Many, many apologies for this confusion - blame it entirely on me.

I'm not entirely sure how this came about (or how it's not been noticed before), but there's an error in the code.

The inner loop should be:

        For Each ctlControl In Forms(objAO.Name).Controls
            ctlControl.FontName = strFont
        Next

Notice that the collection we are looping through is not objAO.Controls, but the Controls collection of the open form.

It is OK to use the open form because it is open in design view, and therefore when we save we can save the changes.

17-Jun-02 1
700 Page 700 Error in code

The code should read as follows:

Public Property Let Height(dblParam As Double)
dblHeight = dblParam
Sides(1).Length = dblParam
Sides(3).Length = dblParam

End Property

Public Property Let Width(dblParam As Double)
dblHeight = dblParam
Sides(2).Length = dblParam
Sides(4).Length = dblParam

End Property



Thanks to David Sussman

22-Feb-01 1
709 Page 709 Error in code

The code on p709 should read as follows:

Dim clsUser As New cUser

'set the user name - this reads in the current user
'password and last change date
clsUser.Name = CurrentUser()

'see if the password needs changing
If clsUser.PasswordNeedsChanging Then
'password has expired so force a password change
DoCmd.OpenForm "frmPasword", . . .
End If

'change the password
If clsUser.PasswordChange ("OldPassword", "NewPassword", strResult) = True Then
MsgBox "Password change succeeded."
Else
MsgBox strResult
End If




Thanks to David Sussman

18-May-01 1

Related Titles

More By These Authors

Database & Data Warehousing Technologies

by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein
by Rick Greenwald, Robert Stackowiak, Gary Dodge, David Klein, Ben Shapiro, Christopher G. Chelliah
by Paul Wilton, John Colby
Back to Top