Wrox Programmer Forums
|
BOOK: Beginning Access 2003 VBA
This is the forum to discuss the Wrox book Beginning Access 2003 VBA by Denise M. Gosnell; ISBN: 9780764556593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access 2003 VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2006, 09:48 PM
Registered User
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 clsCar

I'm getting an error when I run the form designed in Ch.4, I downloaded the book's code and ran the form and no errors. I have checked the code 1/2 dozen times and I can't see it.
The error says "The expression OnLoad you entered as the event property setting produced the following error: Cannot handle events for the object specified.
The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]. There may have been an error evaluating the function, event, or macro."
I've checked my code and it is exactly as written in the book. Is there a reference I'm missing. I'm stumped.

DavidG
 
Old June 15th, 2006, 09:08 AM
Registered User
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm posting a reply to my own problem because I found what was wrong. I had accidently put the same line of code in the standard module AND the class module. This resulted in a confused program which then raised the error

DavidG
 
Old July 14th, 2006, 04:57 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What was this line of code as I am getting the same error on form opening. - cheers!

 
Old July 14th, 2006, 05:11 AM
Registered User
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by magicman
 What was this line of code as I am getting the same error on form opening. - cheers!

Dim WithEvents objCar As clsCar
I had duplicated this in the clsModule as well as in the form itself.
That line of code needs to go into the form's module.

DavidG





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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