Assigning a TextBox Control via a Class Property
Another cry for help from someone lost in the wilderness...
I have a class that defines a TextBox as a property, along the lines of:
Private WithEvents JunkBox As TextBox
Public Property Get BoxData() As TextBox
Set BoxData = JunkBox
Form_Load creates an instance of the class, and uses the Set Property to assign an existing TextBox on the form to the newly-created object:
Private Sub Form_Load()
Dim m_Object As clsClass
Set m_Object = New clsClass
Set .BoxData = txtTextBox
Stepping through the code, I access the various properties and methods of the class, so I know the form "sees" the class. However, the assignment of the text box control from the form to the object doesn't work. txtTextBox is set to "" when I try to Set .BoxData. How do I get the class/object to recognize the TextBox control?
Thanks in advance for your help!