DWUTKA at marlow.com
DWUTKA at marlow.com
Tue Jun 13 11:23:41 CDT 2006
And where do you declare the object? Let's say MyClass has an event. Now I have three forms that need to see that event. Dim withevents MyClassObject as MyClass That would go in the declarations, but how to you get all three forms to see the same event? If each form had this in the Form Load event: Set MyClassObject=New MyClass Now each will see AN event when it is raised, but if form1 triggers the event, it's going to get the event from it's instance of MyClass. None of the other forms will. However, if MyClass was a global variable: Public GlobalMyClass As MyClass And the Load events had: Set MyClassObject=GlobalMyClass Now, when the event is triggered all three forms see the event. Drew -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Tuesday, June 13, 2006 10:49 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ... Huh? What are you declaring globally? You raise an event from the class and sink it in the other objects. What does a global have to do with that? Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com Sent: Monday, June 12, 2006 5:25 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ... A class object with custom events. If you want multiple objects to 'see' that/those event(s), then you have to declare it globally. Putting it as a property of a form and keeping that form open is just a hackneyed way of creating a global variable. (And is pretty stupid, because if that form isn't needed, it's a waste of resources to keep it open for a class that could be kept open on it's own.) Drew -----Original Message----- From: Josh McFarlane [mailto:darsant at gmail.com] Sent: Monday, June 12, 2006 4:18 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Class Rebuttal was: Basic Unbound Form ... I'd be interested in seeing this instance where an unprotected global variable has to exist. Josh -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com