Yes. It's not generally done, and will probably make your code more difficult to follow and understand when you are trying to add/update things later..... beyond that, as was mentioned in another thread, you'll be using more memory (to create an object variable to an object that already exists) to work with data and store data that already exists in the object. HOWEVER, it CAN be done. Here is a small example that I just built, with nothing but a form and a textbox..... in the form_load, I put this:
Dim x As Object
Set x = Text1
x.Text = "hi"
And the .text property of the text1 textbox has changed to "hi". Again, I advise against this method for a large number of reasons, but certainly it can be done, and will work.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
No... recdata is a variable that will contain information received from a socket. It is, in no way shape or form, an object. I don't understand what you are doing, or trying to get accomplished, but let me lay out how this reads:
1. Send The Literal String (send the word) "text1" across the network
- if you are trying to send the data that the user typed into text1
-across the network, you would do winsck1.sendata text1.text
2. declare X as an object variable
3. read data from the network, and store it in a variable called RecData
4. Try to set an object variable to the value stored in RecData
-set binds a variable to the specified object.
-you can not bind an object to a variable value....
-the RecData variable has no .text property, no enabled property
or any other kind of property.... it's just a variable that holds a
value, not an object variable.
5. Try to set the .Text Property Of the Object Variable X to "hi"
-Since You can't set X (an object variable) to a scalar variables
value, this will fail, if the line before it did not terminate the
program due to errors.
I do understand, however, what you are trying to do. You want to send an object reference across the network, and then use that object reference on the receiving machine. The problem is, the receiving machine wouldn't have that object reference.....
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215