locked
Autocomplete with Textbox Problem RRS feed

  • Question

  • Hello,

    I am trying to set autocomplete for a textbox using data from a column in a table an Access database.  Some of those records in the table have no values.   I have set the AutoComplete Mode property to SuggestAppend and the AutoCompleteSource property to CustomSource.  When I run the application nothing happens when I type into the textbox. 

    The dataset is called DatabaseDataSet and the table name in the database is called Simple and the specific field/colum is called SIM_TAG1

    What am I doing wrong?  Here is my code:

     'Create customsource for tag textboxes to suggest tag terms based on what is in database
            Dim oTag As New AutoCompleteStringCollection()
            For Each term As DatabaseDataSet.SIMPLERow In Me.DatabaseDataSet.SIMPLE
                oTag.Add(DatabaseDataSet.SIMPLE.SIM_TAG1Column.ToString)
            Next
            txtTag1Ref.AutoCompleteCustomSource = oTag
    Thursday, August 13, 2009 9:17 PM

Answers

  • Try binding the TextBox to the data and then setting AutoComplete to "List" instead of custom source, or did you try that?

    That normally works for me when I have a ComboBox bound to a table, and that sounds similar to what you're trying to do here, though I've never tried it with a TextBox.

    Be aware though that blank or otherwise, it will show everything in the bound source.
    • Marked as answer by Xingwei Hu Thursday, August 20, 2009 2:45 AM
    Thursday, August 13, 2009 9:46 PM