p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Access VBA (http://p2p.wrox.com/forumdisplay.php?f=24)
-   -   Chapter 7 Code (http://p2p.wrox.com/showthread.php?t=2755)

Ticketyboo August 13th, 2003 11:27 AM

Chapter 7 Code
 
I am trying the exercise on Building an SQL string in Chapter 7 (Pages 289-291). I have copied the frmCriteria from the Complete Database as there is no frmCriteria for Chapter 7 as stated in the book.

A function BuildSQLString already existed which caused a conflict when trying to add the new identically named function so I deleted the existing function.

Now when I run the cmdFind_Click I receive a compile error stating wrong number of arguments or invalid property assignment with EntriesValid highlighted.

Does anyone have any suggestions?


CISProf August 13th, 2003 11:46 AM

The EntriesValid wants an argument, but the actual function doesn't want one. In the cmdFind_Click event take the argument out from the call to EntriesValid, as in:
If Not EntriesValid Then Exit Sub

Ticketyboo August 14th, 2003 05:39 AM

The cmdFind_Click event previously included: -

If Not EntriesValid(strTableName) Then Exit Sub

by removing (strTableName) this has removed the error.

Thanks


AlreadyDead February 2nd, 2004 09:36 PM

Also; When coding the BuildSQLString Function, My tblSales table had no entries from 2002, yet the book asks you to use frmCriteria to build an SQL string from 01-Nov-02 to 30-Nov-02. Table entries are all 1998. Changed 02 to 98, all good. An easily detectable oversight for some, but it had me going for a bit. Grrr.

Dead

Olivia54 July 11th, 2004 07:31 PM

Thanks for the tip, AlreadyDead!

Since the authors indicate that running the MakeQueryDef function in the Immediate window should return a value of true, I spent a lot of time trying to figure out why it kept returning a value of false. Having received no response to any of my prior posts, I didn't come back to this forum for help until just now and I'm glad I did.

Thanks, again!!!:)



All times are GMT -4. The time now is 08:32 PM.

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