p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Access 2003 VBA (http://p2p.wrox.com/forumdisplay.php?f=150)
-   -   creating an event for a custom class? (http://p2p.wrox.com/showthread.php?t=22663)

lkubler December 15th, 2004 09:52 PM

creating an event for a custom class?
 
Hi,

Just got this book and am quite pleased with it so far. I'm in chapter 4 and am trying to create the event for the Car class and I'm having trouble.

Here's what is happening:
On page 111 it says to declare the event with the "public event" statement in the general declarations section of the clsCar class module. When I enter the following line in the general declarations section:

Public Event ActionSuccess(strMessage As String)

I get this error:
Compile Error: Only valid in object module

Anyone have any suggestions? I'm using Access 2002, could this be a difference between 2002 and 2003? Or is this an error in the book possibly?

Thanks in advance for any help,
Linn

cyfoes December 22nd, 2004 08:07 PM

Hi
Just got the book as well. There don't seem to be errors with Access 2003 in this chapter. Have you tried downloading the code from the web into Access 2002 which should tell you if the error is due to a typo or the version.



lkubler December 23rd, 2004 02:15 AM

Thanks for replying cyfoes. I found my problem, I inserted a standard module instead of a class module back on step 2 on page 105. Just moving too fast for my own good. Once I inserted a class module and copied all the code over it worked fine.

Thanks,
Linn



Jacky Kenna September 20th, 2005 03:47 PM

Hi Linn and cyfoes

I have read your entries and I would love to know how you have both got on with book and would you recommend it?

Jacky KennA



All times are GMT -4. The time now is 06:36 PM.

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