0

How do I get a textbox to automatically update with information when I select an item from a combobox? txtCustID.Text = Custds.Tables(0).Rows(cboCustomer.SelectedIndex).Item("custno") is what I came up with, and it populates properly when the combobox is first loaded up, but if I select another item, the text boxes don't change. Can anybody show me what I'm doing wrong?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by bajanpoet
1

Trap SelectedIndexChanged event of the combo box

Private Sub cboCustomer_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboCustomer.SelectedIndexChanged

  txtCustID.Text = Custds.Tables(0).Rows(cboCustomer.SelectedIndex).Item("custno")

End Sub
Votes + Comments
Simple and easily understood post - with example!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.