populate combo box from a dataset

Hi,
can i please have help to populate a combo box from my dataset. On form loadup, i need to populate my combo box with the items in1 of my tables in my DataSet.

thanks allot

cheers
LVL 4
CraigLazarAsked:
Who is Participating?
 
Wayne Taylor (webtubbs)Connect With a Mentor Commented:
With Combobox1
    .DataSource = MyDataSet.Tables("TableName")
    .DisplayMember = "DisplayField"
    .ValueMember = "ValueField"
End With

Wayne
0
 
CraigLazarAuthor Commented:
thanks mate perfect
0
 
CraigLazarAuthor Commented:
if u do not mind me asking, but how would i attach the display values id to the items as then i want to save the itemID in a table and not the actual display name that the user sees in the combo box?
As in my dataset i have the display name and the itemid as fields in the dataset
thanks allot
0
 
Wayne Taylor (webtubbs)Commented:
Use Combobox1.SelectedValue.

Wayne
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.