Solved

Get the ValueMember value from a Combo box

Posted on 2004-08-11
2
534 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 50 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

24 Experts available now in Live!

Get 1:1 Help Now