Solved

Get the ValueMember value from a Combo box

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Library to convert HTML to PDF. 8 57
Changing the Source of an ADO Recordset while it's open 4 37
Spacing between controls 4 30
More on Time zones in vb 2010 12 37
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

920 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

13 Experts available now in Live!

Get 1:1 Help Now