• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

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
0
CraigLazar
Asked:
CraigLazar
  • 2
  • 2
1 Solution
 
Wayne Taylor (webtubbs)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

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now