Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Access to program Variables


Hi everybody ,

I need you help for my problem. I need the following functionality of a program: I built a simple user form with one text box and a command button. In this text box, I want to enter a variable name used in my program and after clicking the command button, the program should display the content of that variable. So, I will have the varibale name in a string. How do I get the content of a variable if I have the variable name specified in a string? Are there any special functions in VB for this ?

Thank you,

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    :
    : Hi everybody ,
    :
    : I need you help for my problem. I need the following
    : functionality of a program: I built a simple user form with one text
    : box and a command button. In this text box, I want to enter a
    : variable name used in my program and after clicking the command
    : button, the program should display the content of that variable. So,
    : I will have the varibale name in a string. How do I get the content
    : of a variable if I have the variable name specified in a string? Are
    : there any special functions in VB for this ?
    :
    : Thank you,
    :

    Your only chance:
    [code]
    VariableName = Text1.Text
    Select Case VariableName
    Case "x"
    Text2.Text = x
    Case "i"
    Text2.Text = i
    ...
    End Select
    [/code]

    I know it's a late response, but I hope it's still useful to you.

    If you're doing this to debug, use either Debug.Print statement or debugger ;)

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.