PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] Easy way to pick another text box depending on an option-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Easy way to pick another text box depending on an option

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    21

    Resolved [RESOLVED] Easy way to pick another text box depending on an option

    Hello,

    Here's my problem.
    Depending on an option chosen by the user, another text box should be filled with data that is coming from a text file.

    I know you can do something with a select case or an if then, but if I do that, I will have to adapt the code in a lot of different places.

    So I was wondering, if something like this possible:
    if opt1 then
    textboxtouse = textbox1
    else
    textboxtouse = textbox 2
    end if

    Thanks in advance.

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Easy way to pick another text box depending on an option

    vb Code:
    1. Dim ctlTextBox As Control
    2.  
    3. If Opt1.Value Then
    4.     Set ctlTextBox = Text1
    5. ElseIf Opt2.Value Then
    6.     Set ctlTextBox = Text2
    7. End If

    Then, in the code that loads stuff to a textbox, use ctlTextBox instead of the TextBox name.

    When you're all done using ctlTextBox, don't forget to delete it:

    vb Code:
    1. Set ctlTextBox = Nothing

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    21

    Re: Easy way to pick another text box depending on an option

    Sorry for the late reply.
    I've been extremely busy with other things.

    It works.

    Thanks

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width