Hi ,
I am combining 2 fields in a combo box one of which is the supplierName and L/A No as alias ordersupplier which loads fine in the combo box. But when it comes to capturing the SupplierID it is always = 1.
Below is my code in red to capture this value. Does anyone have any idea why Im getting this bug?
Code:SELECT tb_LA.LANo, tb_supplier.supplierID, (RTRIM(tb_LA.LANo) + '- & - ' + tb_supplier.suppName) AS OrderSupplier FROM tb_LA INNER JOIN tb_supplier ON tb_LA.supplierFID=tb_supplier.supplierID
[[/CODE]Code:CODE]Dim query As String = "LASupp_Combo" Dim dtLASuppReport As New DataTable() Dim daLASuppReport As New SqlClient.SqlDataAdapter() Try Dim cmd As New SqlClient.SqlCommand(query, MyConn) cmd.CommandType = CommandType.Text daLASuppReport.SelectCommand = cmd daLASuppReport.Fill(dtLASuppReport) cboLASupp.DataSource = dtLASuppReport cboLASupp.DisplayMember = "OrderSupplier" cboLASupp.ValueMember = "LANo" supplierFID = CInt(CType(cboLASupp.SelectedItem, DataRowView).Item("supplierID"))





Reply With Quote