Dynamic TextBox? RRS feed

  • Question

  • Hi

    Can we make dynamic combobox.

    Like when we start typing any character in it show the list starts from that character.

    see the example :

    Monday, February 18, 2013 9:52 AM

All replies

  • Hi Amit

    "Amit Sony" schrieb im Newsbeitrag

    Can we make dynamic combobox.

    If you want to do filter the entries of the combobox you have to dynamically filter the content of the combobox by changing it's rowsource based on the already entered input.

    It's possible but may be slow if you have a complex query behind the combobox.
    You may do this in the KeyUp event of the combobox.

    An example (not working perfectly yet). Two events: One on Enter of the combo to set the rowsource unfiltered. Then on Key Up filter the rowsource to what has been entered already.

    Private Sub cboYourCombo_Enter()
     Me!cboYourCombo.RowSource = _
         "SELECT CustName FROM Custs"
    End Sub
    Private Sub cboYourCombo_KeyUp(KeyCode As Integer, Shift As Integer)
     Me!cboYourCombo.RowSource = _
         "SELECT CustName FROM Custs" & _
         " WHERE CustName LIKE '" & Me!cboYourCombo.Text & "*'"
    End Sub


    Monday, February 18, 2013 11:19 AM
  • it means we cant make dynamic combobox as displayed in the image???
    Monday, February 18, 2013 2:46 PM