PDA

Click to See Complete Forum and Search --> : Populate combo in code


venerable bede
Sep 18th, 2002, 03:36 AM
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

cim3
Sep 18th, 2002, 04:01 AM
You can add values as with the treenode by creating your own class.
See the code here
http://hunterstone.com/library/SubC...SamplesBody.htm

cim3
Sep 18th, 2002, 04:03 AM
sos that doesn't get there straight away - try http://hunterstone.com/library/SubClassingSamplesBody.htm