Results 1 to 3 of 3

Thread: Populate combo in code

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Populate combo in code

    I populate a combobox with the following code (taken from Karl Moores great book).

    This puts the description in the combo e.g "Dell PC" but I want to know how I can put the field "ItemID" in the combo as Value member property. I need to search on ID but view description.

    For i = 1 To objdataset.Tables("tblItems").Rows.Count
    strCurrentID = objdataset.Tables("tblItems").Rows(i - 1).Item("ItemDescription")
    cboOwners.Items.Add(strCurrentID)
    Next

    Can anyone Help?

    Thanks in Advance

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    You can add values as with the treenode by creating your own class.
    See the code here
    http://hunterstone.com/library/SubC...SamplesBody.htm
    Wind and waves resolves all problems.

  3. #3
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    sos that doesn't get there straight away - try http://hunterstone.com/library/SubCl...amplesBody.htm
    Wind and waves resolves all problems.

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