?
Solved

Get the ValueMember value from a Combo box

Posted on 2004-08-11
2
Medium Priority
?
553 Views
Last Modified: 2008-02-01
Silly question for sure...

I have a combo box bound to a table called STATUS which is in the dataset DsPOLookup1.

I have set the following properties:

The Datasource is DsPOLookup1.STATUS
Display Member is STATUS_DESC
SelectedValue is DsPOLookup1 - STATUS.STATUS_ID
ValueMember is STATUS_ID

When the user selects a value in the combo, I want to use the STATUS_ID (Not the Status_desc) in my filter for the DataView.

What is the syntax please?
Mine is as follows but obviously wrong! Which property of cmbStatus holds the actual value ie. in this case 3 for the status of Approved.

Private Sub cmbStatus_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
cmbStatus.SelectedIndexChanged
        dvPOHeader.RowFilter = "PO_STATUS = " & cmbStatus.ValueMember.ToString
End Sub

Thankyou,
Marnie.
0
Comment
Question by:MarnieHook
2 Comments
 
LVL 8

Accepted Solution

by:
razo earned 200 total points
ID: 11780879
if windows application
cmbstatus.selectedvalue

if web
cmbstatus.selecteditem.value
0
 

Author Comment

by:MarnieHook
ID: 11781133
Thankyou Razo. I knew it must be easy!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

839 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