Results 1 to 4 of 4

Thread: combo box values

  1. #1

    Thread Starter
    Lively Member chongo 2002's Avatar
    Join Date
    Apr 2000
    Posts
    106

    Question

    How do you get values from the selected item in a combo box?

    I use this for a listbox but a combo doesn't have a .selected method.

    Code:
    For L = 0 To results.ListCount - 1
    If results.Selected(L) Then
    txtsomething = results.list(L)
    End If 
    Next
    Sure someone knows the answer since it is an easy question.

  2. #2
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Just use the text property.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  3. #3

    Thread Starter
    Lively Member chongo 2002's Avatar
    Join Date
    Apr 2000
    Posts
    106
    thanks

  4. #4
    New Member
    Join Date
    Oct 2000
    Location
    Houston, Texas
    Posts
    11

    Combo Box

    You can also use the ListIndex to get the selected
    Index. If you need the ItemData value for the selected
    item use:

    Id = Combo1.ItemData(Combo1.ListIndex)

    Corby Nichols

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