PDA

Click to See Complete Forum and Search --> : Evaluating Expressions in VB


Compwiz
Nov 23rd, 1999, 07:42 AM
How (or is it possible) to evaluate an expression that is a string? i.e.

Dim myObject As String
myObject = "Text1"
Eval(myObject).Visible = False


Cheap example but...

------------------
Tom Young, 14 Year Old
tyoung@stny.rr.com
ICQ: 15743470 (http://wwp.icq.com/15743470) Add Me (http://wwp.icq.com/scripts/search.dll?to=15743470) ICQ Me (http://wwp.icq.com/scripts/contact.dll?msgto=15743470)
AIM: TomY10 (http://www.aol.com/aim/aim30.html)
PERL, JavaScript and VB Programmer

Serge
Nov 23rd, 1999, 08:51 AM
Tom,

You can use Controls collection to do what you want:


Dim strMyObject As String

strMyObject = "Text1"
Form1.Controls(strMyObject).Visible = False


------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)