Producing a GOOGLE type SEARCH box in access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ianstow
    New Member
    • May 2010
    • 2

    Producing a GOOGLE type SEARCH box in access 2007

    In access 2007 I am trying to replicate a field on a form that works very similar to the way , for instance , the GOOGLE search box performs ie as soon as you type a letter it drops down a history box with the previous selections you have made and then decreases the options available the more letters that are input until you come the selection that you want and then you accept . I am assuming it is poss using either the combo or list function but as yet have not cracked it. would appreciate help if it is poss.

    Ian
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by Ianstow
    In access 2007 I am trying to replicate a field on a form that works very similar to the way , for instance , the GOOGLE search box performs ie as soon as you type a letter it drops down a history box with the previous selections you have made and then decreases the options available the more letters that are input until you come the selection that you want and then you accept . I am assuming it is poss using either the combo or list function but as yet have not cracked it. would appreciate help if it is poss.

    Ian
    Welcome to Bytes :)

    You can simulate this using a form textbox and a list underneath it or indeed a combobox if that were your choosing. The key areas to this are the 'On change' event to capture what it is you typing in and then perform a search of your existing data to return a logical set of data matching your entry.

    One could get very sophisticated with this, if one was so minded like soundex and whatever other string semantics takes your fancy.

    Have a look at this little demo I have attached which gives you an idea of adding records to a one field table from whatever it is you type into the search box.

    The table with one field is set to primary key so by default it cannot accept duplicates. The code looks at each character you type and queries the database according to which characters are present. The list is populated using a dynamic SQL statement. You jump between the textbox and listbox using the pagedown and up down arrow keys. All the code is located 'behind the form' in the form module. It is quick and dirty but illustrates what it is I believe you are aiming for and it has some sample data in there to use

    Happy coding :-)
    Attached Files

    Comment

    • Ianstow
      New Member
      • May 2010
      • 2

      #3
      Producing GOOGLE type search box

      Much appreciated . this is spot on for the req I need

      many thanks

      ian

      Comment

      • Jim Doherty
        Recognized Expert Contributor
        • Aug 2007
        • 897

        #4
        Originally posted by Ianstow
        Much appreciated . this is spot on for the req I need

        many thanks

        ian
        You're welcome :-) incidentally there is a dedicated Access form on this site but I will leave this thread where it is given it is answered

        Comment

        Working...