Adrian Trantino
Member
Hi Guys,
I have a MySQL table with two fields (Code, Name). I want to display the Name in the combo box but also capture the code as this is the unique identifier in which I need to reference later when pulling data from another MySQL table.
I currently have this to get the Name into the combobox.
Or alternatively, I want to be able to grab the code on ComboBox_ValueChanged
Sub UpdateListItems
ComboBox1.Items.Clear
Dim RS As ResultSet = sql1.ExecQuery("Select Code, Name from Store")
Do While RS.NextRow
ComboBox1.Items.Add(RS.GetString("Code"))
Loop
End Sub
I have a MySQL table with two fields (Code, Name). I want to display the Name in the combo box but also capture the code as this is the unique identifier in which I need to reference later when pulling data from another MySQL table.
I currently have this to get the Name into the combobox.
Or alternatively, I want to be able to grab the code on ComboBox_ValueChanged
Sub UpdateListItems
ComboBox1.Items.Clear
Dim RS As ResultSet = sql1.ExecQuery("Select Code, Name from Store")
Do While RS.NextRow
ComboBox1.Items.Add(RS.GetString("Code"))
Loop
End Sub