Results 1 to 2 of 2

Thread: Evaluating Expressions in VB

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    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
    [email protected]
    ICQ: 15743470 Add Me ICQ Me
    AIM: TomY10
    PERL, JavaScript and VB Programmer

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]
    ICQ#: 51055819


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width