Get the ValueMember value from a Combo box
Posted on 2004-08-11
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
dvPOHeader.RowFilter = "PO_STATUS = " & cmbStatus.ValueMember.ToString