Hello
After searching around on the internet, I have figured out how to populate a combobox (from a SQL table (table1)) but now I have a few more questions
This combobox is on a form, that contains a bunch of textboxes that are linked to another SQL table (table2).
Right now it displays the correct data when nothing has been selected. What I can't figure out is how to have it send the selected item to the appropriate field in table2 when a user selects an item from the list...
This is my code to populate my Combobox
'Populate Peer Review Combobo
DsEmp1.Clear(
SqlDA_Emp.Fill( DsEmp1, "TSY_USER"
Dim dtEmp As New DataTabl
dtEmp.Columns.A dd("ID_USER", GetType(System. String)
dtEmp.Columns.A dd("STR_NAME_F" , GetType(System. String)
Dim drDSRow As DataRo
Dim drNewRow As DataRo
For Each drDSRow In DsEmp1.Tables(" TSY_USER").Rows (
drNewRow = dtEmp.NewRow(
drNewRow("ID_US ER") = drDSRow("ID_USE R"
drNewRow("STR_N AME_F") = drDSRow("STR_NA ME_F"
dtEmp.Rows.Add( drNewRow
Nex
Me.cbxPeerRevie w.DropDownStyle = ComboBoxStyle.D ropDownLis
With cbxPeerRevie
.DataSource = dtEm
.DisplayMember = "STR_NAME_F
.ValueMember = "ID_USER
.SelectedIndex =
End Wit
Thanks!
ambe
After searching around on the internet, I have figured out how to populate a combobox (from a SQL table (table1)) but now I have a few more questions
This combobox is on a form, that contains a bunch of textboxes that are linked to another SQL table (table2).
Right now it displays the correct data when nothing has been selected. What I can't figure out is how to have it send the selected item to the appropriate field in table2 when a user selects an item from the list...
This is my code to populate my Combobox
'Populate Peer Review Combobo
DsEmp1.Clear(
SqlDA_Emp.Fill( DsEmp1, "TSY_USER"
Dim dtEmp As New DataTabl
dtEmp.Columns.A dd("ID_USER", GetType(System. String)
dtEmp.Columns.A dd("STR_NAME_F" , GetType(System. String)
Dim drDSRow As DataRo
Dim drNewRow As DataRo
For Each drDSRow In DsEmp1.Tables(" TSY_USER").Rows (
drNewRow = dtEmp.NewRow(
drNewRow("ID_US ER") = drDSRow("ID_USE R"
drNewRow("STR_N AME_F") = drDSRow("STR_NA ME_F"
dtEmp.Rows.Add( drNewRow
Nex
Me.cbxPeerRevie w.DropDownStyle = ComboBoxStyle.D ropDownLis
With cbxPeerRevie
.DataSource = dtEm
.DisplayMember = "STR_NAME_F
.ValueMember = "ID_USER
.SelectedIndex =
End Wit
Thanks!
ambe