Solved

Get the ValueMember value from a Combo box

Posted on 2004-08-11
2
542 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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