title: combobox text still showing previous value on change
body: <p>I am using 1 combobox to populate a 2nd combobox. What is happening however, is that the 2nd combobox dropdown is changing and displaying the correct values but when the change occurs, the text property still retains the old value. I am using items.clear() and thought that would also clear the text value of the combobox. </p>
  
  <p>I am using winforms and would be grateful if someone could point out my newbie error. Thanks</p>
  
  <pre><code>Private Sub cmbCustomer_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbCustomer.SelectedIndexChanged
  
          ' This is the routine to populate the departments box with values from customer
  
          sql = "SELECT * from Departments WHERE Customer = ?"
  
          Dim cmd As New OleDb.OleDbCommand
  
          cmd.Parameters.AddWithValue("@p1", cmbCustomer.Text)
  
          cmd.CommandText = sql
          cmd.Connection = oledbCnn
          dr = cmd.ExecuteReader
  
          cmbDept.Items.Clear()
          cmbRequestBy.Items.Clear()
  
          While dr.Read()
  
              cmbDept.Items.Add(dr("Name"))
  
          End While
  
          cmd.Dispose()
          dr.Close()
          'oledbCnn.Close()
  
  
      End Sub
  </code></pre>