AutoComplete

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alinagoo
    New Member
    • Apr 2010
    • 53

    AutoComplete

    How a Bounded TextBox could give AutoComplete choices from a field in a table to the user?

    I searched about this in the internet but i could not found any things!

    Thanks in Advanced
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Hi
    Since I don't know how experienced you are, im gonna start of by asking:
    Are you sure a combobox doesn't suit your needs? They come with autocomplete.

    Try explaining what you need it for, that will allow us to give you the best possible help.

    Comment

    • alinagoo
      New Member
      • Apr 2010
      • 53

      #3
      Originally posted by TheSmileyOne
      Hi
      Since I don't know how experienced you are, im gonna start of by asking:
      Are you sure a combobox doesn't suit your needs? They come with autocomplete.

      Try explaining what you need it for, that will allow us to give you the best possible help.
      If a field's value/values be predictable or constant the best way ,as you said,is ComboBoxes But assume that a field such as "LastName" with various values,I do not know all last names in the world to enter in a Comboboxe's source data to use!
      in other way ,with TextBoxes, it is not interesting Database user types all last names even that are similar and repetitive!

      Thanks So
      &
      Excuse me for puny English knowledge

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        ...I do not know all last names in the world to enter in a Comboboxe's source data to use!
        I'm sorry but your post simply makes no sense! There is no way for any autocomplete hack to work, whether a combobox or a textbox, without a source! Where do you think Access is going to come up with the data to attempt to guess whether you mean Adams or Adar when you type in Ad if it doesn't have a sorce for last names?

        The best approach for this, as Smiley said, would be a combobox with its inherent autocomplete (actually called Autoexpand) feature. You can then use the NotInList event of the combobox to write a routine to add new names as you come to them.

        Linq ;0)>

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          I would use a combobox, with the rowsource set to:
          "SELECT distinct tx_LastName FROM tbl_Users ORDER BY tx_LastName"

          This will let you use all the previous entries as a source of autocompletion. (or autoexpand as missingling wrote.

          Comment

          • alinagoo
            New Member
            • Apr 2010
            • 53

            #6
            Originally posted by missinglinq
            I'm sorry but your post simply makes no sense! There is no way for any autocomplete hack to work, whether a combobox or a textbox, without a source! Where do you think Access is going to come up with the data to attempt to guess whether you mean Adams or Adar when you type in Ad if it doesn't have a sorce for last names?

            The best approach for this, as Smiley said, would be a combobox with its inherent autocomplete (actually called Autoexpand) feature. You can then use the NotInList event of the combobox to write a routine to add new names as you come to them.

            Linq ;0)>
            You are right!
            Assume now db is empty and a user wants to store "Adams" family then he/she must type "Adams" Completely and it is no problem for my user to type a word completely in the first time but i want in the second time or after that when the user types "A" Access shows him/her "Adams"or the other word entered previously in the table and starts with "A" and when user types "d" shows to the user the first word in the table starts with "Ad" ,maybe "Adams",.....wi th progress in data entry and become database bigger doing type become easier and easier than the past.
            if i am in wrong please tell me.
            Best wishes for you
            A.M

            Comment

            • alinagoo
              New Member
              • Apr 2010
              • 53

              #7
              Originally posted by TheSmileyOne
              I would use a combobox, with the rowsource set to:
              "SELECT distinct tx_LastName FROM tbl_Users ORDER BY tx_LastName"

              This will let you use all the previous entries as a source of autocompletion. (or autoexpand as missingling wrote.
              It worked great!Thanks.bu t i liked to this by a text box.
              No problem.
              Bye

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32656

                #8
                The facility is not available in a TextBox I'm afraid.

                Linq's post explains how to get as close an approximation as possible using ComboBoxes, but the feature you are describing (like that available in Excel) is not available in Access.

                Comment

                Working...