Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Beginning Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Access VBA
This is the forum to discuss the Wrox book Beginning Access 2002 VBA by Robert Smith, Dave Sussman, Ian Blackburn, John Colby, Mark Horner, Martin Reid, Paul Turley, Helmut Watson; ISBN: 9780764544026
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 13th, 2004, 02:10 PM
Registered User
Join Date: Jul 2004
Location: Suisun City, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 8: Results Table not building

I'm trying to run the Matching Records code in Chapter 8, page 271 - 272.

When I click on the Criteria form's Find Matches button, I get the error string "There was a problem building the SQL string".

The book says (page 272, step 6): "Now open the criteria form frmCriteria in form view and hit the Find Matches button without entering any criteria."

This is supposed to bring up the frmSales form, which isn't happening (see above error). In addition, this should be creating the table tblResults, which isn't happening either.

So, I'm apparently dying at the

If Not EntriesValid Then Exit Sub

If Not BuildSQLString(strSQL) Then
    MsgBox "There was a problem building the SQL string"
    Exit Sub
End If

chunk of code and never making it to the BuildResultsTable function.

What am I missing?

Note: I've also tried entering criteria in the form, but I die at the same place in the code.

Thanks in advance,


Reply With Quote
  #2 (permalink)  
Old September 7th, 2004, 06:11 AM
Registered User
Join Date: Sep 2004
Location: glasgow, , United Kingdom.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Steve,

I have had the same problem and realised that they have forgotten to mention that the following codes needs to be added for the EntriesValid.
When checking into the later chapter, I founf it:
Just add it into the frmCriteria as a new function:

Function DisplayResults(lRecords As Long) As Boolean

Dim iReturn As Integer
Dim sMsg As String

Select Case lRecords
    Case 0
        sMsg = "No records matched the criteria you specified."
        MsgBox sMsg, vbExclamation, Application.Name
        DisplayResults = True
        Exit Function
    Case 1
        sMsg = "1 record matched the criteria you specified."
        sMsg = sMsg & vbCrLf & vbCrLf & "Would you like to see it?"
    Case Is > 1
        sMsg = lRecords & " records matched the criteria you specified."
        sMsg = sMsg & vbCrLf & vbCrLf & "Would you like to see them?"
End Select

iReturn = MsgBox(sMsg, _
            vbQuestion + vbYesNo + vbDefaultButton1, _

If iReturn = vbYes Then
    DoCmd.OpenForm "frmSales"
    DoCmd.Close acForm, Me.Name
End If

DisplayResults = True

End Function

Good luck,
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4 building error LanceWang BOOK: Professional Java Development with the Spring Framework 0 March 7th, 2008 06:53 PM
Chapter 10 - building objects kscase BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 5 April 23rd, 2007 04:55 AM
building crystal report table programmatically khaled_mm VB Components 1 October 6th, 2006 02:26 AM
Building table rows dynamically nikotromus General .NET 2 January 21st, 2006 11:10 PM

All times are GMT -4. The time now is 07:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.