i had set an outlook table using adodb.recordset. The table have 2 field : 'ID' and 'ITEM_NAME'.
I would like to set my COMBO BOX with all the 'ITEM_NAME' values from the table without using combo.additem method, because the recordcount is to many. how to set the 'Item_name' table fields into the combo box

combo box using table field as the source (beginner)
BFlynn
Rolf Kleppestø
you would do a databind in this case so.....
Me.theComboBox.DataSource = theDataSet.Tables(0).DefaultView
Me.theComboBox.DisplayMember = "ITEM_NAME"
this will automatically bind the field "ITEM_NAME" to the combobox from the datasource, being the datatable/dataset in my example
does this help
EvilOneSD
i couldn't find the .tables(0).defaultview property on my recordset and also .Displaymember property on the combo box.
This is the code i wrote manually to add item to combo box
With rs_stock
If .RecordCount > 0 Then
.MoveFirst
Do While .EOF = False
Cmb_item.AddItem .Fields("name").Value
.MoveNext
Loop
End If
End With
morphius1
Andrew Maddison
:-) Thats the problem.
These forums are for .NET development.
VB6 questions should be posted here:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx dg=microsoft.public.vb.general.discussion&cat=en_us_ab067bc0-bda5-4921-a1ec-e76402873945&lang=en&cr=us