Results 1 to 15 of 15

Thread: Searching MS Access Database using combobox ? [google way]

  1. #1

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Searching MS Access Database using combobox ? [google way]

    Im new to db access and Im not quite familiar to searching. How can I search all my field and will show the nearest match for the keyword and will be shown under the combobox the nearest results that it can find in my db. Like searching search engines like Google that you can find their suggestions under the combobox ?
    Last edited by networkmancer; Mar 23rd, 2011 at 11:01 AM.
    Requiscat En Pace

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Searching Keywords for MS ACCESS

    What's your definition of "nearest"?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    hmm. Closest match .

    When you try searching in a search engine then it will prompt in a combobox the results that match the one that your typing. I want to have when Ill try to put Alexan and I have alexander on my first name in my database then it will show Alexander in list of combobox.
    Requiscat En Pace

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Searching Keywords for MS ACCESS

    That's not a definition. You can't use some wishy-washy description like that because you have to write code to implement it. You have to have an exact, implementable definition. Computers don't have intuition like human beings do. Computers follow hard and fast rules, so you have to decide what those rules are.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    Whats with that? I was just describing what It supposed to look like. I gave already examples.
    Requiscat En Pace

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Searching Keywords for MS ACCESS

    An example is not a definition. It's an example. Do you mean that you want to get all the values that start with the value you entered? All the values that contain the value you entered? Something else? Case-sensitive or case-insensitive? Also, what would make one such match "nearer" than another?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Searching Keywords for MS ACCESS

    Also, regardless of how you get the data, how exactly do you want it to be used? It sounds like you probably want to use the auto-complete functionality built into the TextBox or ComboBox class, but it's not clear which. You say ComboBox but you may be confusing the auto-complete list with the drop-down list, which are different. If you can provide a full and clear description then we can provide the most informed advice, rather than assume and guess and maybe get right or maybe not.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Searching Keywords for MS ACCESS

    What you need is Levenshtein Distance

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Searching Keywords for MS ACCESS

    Quote Originally Posted by CVMichael View Post
    What you need is Levenshtein Distance
    That's useful for full-text searching...

    It sounds to me like the OP wants the "Suggest" type of auto-complete which is built in to TextBoxes and ComboBoxes.
    A custom AutoCompleteSource can be specified if the items aren't already in the combo box's data provider.

  10. #10

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    Thanks for the reply guys. I do not know what to use exactly but I want like the Google way , it is not really necessary to auto complete as long as it will show the available matches in my access database.

    Hope this simple layout explains
    Requiscat En Pace

  11. #11

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    Anyone? I cant search this forum because it will just give me this error..

    Code:
    Your submission could not be processed because the token has expired.
    
    Please push the back button and reload the previous window.
    Requiscat En Pace

  12. #12
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Searching Keywords for MS ACCESS

    Hi networkmancer,

    You just have to search for every keystroke, and populate a drop down with the result.

    Make a query something like:

    SELECT TOP 10 Name
    FROM your_table
    WHERE Name LIKE string_typed + '*'

    And put the result in the drop down

  13. #13

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    @CVMichael
    Thanks for your reply but I really dont know the exact codes to be use and procedures. Can you guide me?
    Requiscat En Pace

  14. #14
    New Member
    Join Date
    Mar 2011
    Posts
    13

    Re: Searching Keywords for MS ACCESS

    just like CVMichael said,

    SELECT Name[ the row of the table which you want it to search for, for my case i want it to search for the Name row ]
    FROM Table 1 [Your table name]
    WHERE Name LIKE @value + N'%' [ the code for filtering your row (LIKE @value + N'%') ]

    NOTE : Use the "Add Query" function provided in the DataGridview task of your table

    Good Luck

  15. #15

    Thread Starter
    Lively Member networkmancer's Avatar
    Join Date
    Jan 2011
    Posts
    98

    Re: Searching Keywords for MS ACCESS

    Can you guys guide me step by step? sorry for the disturbance really. I cannot really follow you guys because I just go with the database wizard. The deadline is fast approaching that is why I cannot learn manual coding of db this time because of the deadline.
    Requiscat En Pace

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width