Solved

populate combo box from a dataset

Posted on 2008-06-22
4
243 Views
Last Modified: 2013-11-26
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
Comment
Question by:CraigLazar
  • 2
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 50 total points
Comment Utility
With Combobox1
    .DataSource = MyDataSet.Tables("TableName")
    .DisplayMember = "DisplayField"
    .ValueMember = "ValueField"
End With

Wayne
0
 
LVL 4

Author Closing Comment

by:CraigLazar
Comment Utility
thanks mate perfect
0
 
LVL 4

Author Comment

by:CraigLazar
Comment Utility
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
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
Comment Utility
Use Combobox1.SelectedValue.

Wayne
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now