Results 1 to 4 of 4

Thread: [RESOLVED] store variable from combo box list

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Resolved [RESOLVED] store variable from combo box list

    I have two form, FORM 1 and FORM 2.

    I have combo box with list item, All in form1

    0 - "A"
    1 - "B

    When I choose "A" from combo box in FORM1 , How I can show the selected list(Variable) to be display in textbox on form 2 ?


    Code:
    Combo1.ListIndex = 0
             Combo1.Text = Combo1.List(Combo1.ListIndex)

  2. #2
    Addicted Member
    Join Date
    Jun 2006
    Posts
    172

    Re: store variable from combo box list

    Assuming the textbox on your second form is called Text1

    vb Code:
    1. Form2.Text1.Text = Combo1.List(Combo1.ListIndex)

    That would be the quickest way. You can also setup a Sub to change it as well.
    • If you found my post to be helpful, please rate me.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: store variable from combo box list

    From Form 1 to From 2, It show the List in the textbox on form2. Then Form 2 to Form 3 and back again to Form2, How I can retain the List show in textbox in Form2 ? It seem, the list clear in Form 2. The flow like that

    Code:
    Form1 -- >  Form2 -- Form 3 -- > Form 2 again.
             OK                          'Text1 = clear'. Why?
    'I put the code in Form1

    form2.Text1.Text = Combo1.List(Combo1.ListIndex)

    'What code I need to put in Form 3 ?

  4. #4
    Addicted Member
    Join Date
    Jun 2006
    Posts
    172

    Re: [RESOLVED] store variable from combo box list

    Form3.Text1.Text = Combo1.List(Combo1.ListIndex)

    or.. in Form2

    Form3.Text1.Text = Form2.Text1.Text
    • If you found my post to be helpful, please rate me.

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