Click to See Complete Forum and Search --> : Control = Object - How?


Invoker
September 30th, 2001, 06:46 AM
Hi All,

Situation:
I have a Form1 with TextBox1 (from MS Forms 2.0) on it.
I have variable called 'obj' type is Object.
Value of variable is Textbox.Object

Question:
How can I do something like this:

set TextBox1.Object = obj




If I write like above I got "Type Mismatch" error.

Thanks.

tbscope
September 30th, 2001, 07:45 AM
Your textbox is already a control.
So you can't write something like text1.object

Maybe this helps:

Private Sub Form_Load()

Dim obj As Object

Set obj = Text1
'Now you can do something like obj.text = ""

End Sub

Maybe if you explain what you want to do, I or somebody else can give you better information.

Invoker
September 30th, 2001, 08:58 AM
I already have 'obj' object variable, with contains TextBox.Object

Q: How can I do: Set TextBox1 = obj?