Back then I had no idea that a Form was itself a class object and multiple instances could be created of it.
It is interesting how we find stuff as developers and how the order we stumble across things often influnces our coding strategies. I started using instances before I even contemplated the things you are using it for.
So, I understand that if I were to ever create multiple instances of a form, then my spin through the Forms collection would also break. Operating with known risk since the application only ever creates one instance at a time.
Yes that is the issue from my instance-driven perspective. Although it isn't a problem the way you are using it with a single form, a loop through the Forms collection isn't really the best way to get hold of an encapsulated form.
Typically when encapsulating an object into another class, that class would include a property to return a pointer to the encapsulated object and it would only be referred to from outside the encapsulating class object via that property.
So in the case of a form I would have a Form Property in the class and set that to the desired form when the class object is instantiated.
I suppose it would even make sense to follow the pattern of a subform control and have a property like the SourceObject (a string), and a Form property (an object) that is set when the "SourceObject" Property is Let.
To date I have only encapsulated controls and had not contemplated doing it with a whole form. Now that I think about it I can see why one might do that.
When I communicate between forms I have simply called a method of the target form. This technique can be generalised by including a property to designate the form that is being targetted but the form must be specifically enhanced to do any of this.
Using an Event Listener as you are doing avoids the need for doing anyhting special in the sending form. Any form could simply be encapsulated and it would have no need to even care about communication or even what is listening because the other form is aware of its events and taking all the action.
No doubt ersocia is wondering what we are going on about but I really do find the best stuff I learn comes out of these discussion that are initiated with a "by the way" comment like Michael's. It is one of the reasons I keep coming here and participating in threads that might seem quite mundane to many.