P
Paul Ilacqua
Data Entry App Using VB 2005
I'm filling a combobox (code below) with a List(Of CWO) , a class I
defined.. No problem. Lookups return a CWO type, again no problem.
I have a "Load Last Record" function that will populate the form along with
that combobox with values from the database. The value coming in is the
"ValueMember", not the "DisplayMember". How can I load the "ValueMember" but
have the combobox display the DisplayMember?
Dim CWOList As New List(Of CWO)
Dim MyCWO As CWO
SqlDr = ESData.GetReader(sSQL, False)
Do While SqlDr.Read
MyCWO = New CWO
MyCWO.CWONumber = SqlDr(0).ToString
MyCWO.CWOText = SqlDr(1).ToString
CWOList.Add(MyCWO)
Loop
SqlDr.Close()
With ComboBox1
.DataSource = CWOList
.ValueMember = "CWONumber"
.DisplayMember = "CWONumAndText"
End With
set a combobox value that has been filled with list of
I'm filling a combobox (code below) with a List(Of CWO) , a class I
defined.. No problem. Lookups return a CWO type, again no problem.
I have a "Load Last Record" function that will populate the form along with
that combobox with values from the database. The value coming in is the
"ValueMember", not the "DisplayMember". How can I load the "ValueMember" but
have the combobox display the DisplayMember?
Dim CWOList As New List(Of CWO)
Dim MyCWO As CWO
SqlDr = ESData.GetReader(sSQL, False)
Do While SqlDr.Read
MyCWO = New CWO
MyCWO.CWONumber = SqlDr(0).ToString
MyCWO.CWOText = SqlDr(1).ToString
CWOList.Add(MyCWO)
Loop
SqlDr.Close()
With ComboBox1
.DataSource = CWOList
.ValueMember = "CWONumber"
.DisplayMember = "CWONumAndText"
End With
set a combobox value that has been filled with list of