Referencing Activity Objects in Class Modules

Jack Cole

Well-Known Member
Licensed User
Longtime User
Not sure if this post belongs here or in the bugs and wishlist forum. First, I just want to say a big thank you to Erel for the addition of class modules.

I have encountered one problem using the class modules, and it may be that I am doing something incorrect or using them in a way other than intended.

Here is the problem I am having. When loading a layout in a class module created by the designer, code within the class module sees the activity objects used in the layout as not being initialized. So, let's say you have a label that was in the layout and you try to change the text of the label in the class module. I get an object not initialized error. Interestingly, the events of these objects are triggered fine within the class module (such as button clicks).

When I add activity objects programmatically within a class module (such as a label), the same problem is not encountered. It is only when loading a layout generated by the designer. I have attached a bare bones app which replicates the problem.

Any ideas or solutions would be appreciated.
 

Attachments

  • classtest.zip
    6.7 KB · Views: 170
Top