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 ?
Re: Searching Keywords for MS ACCESS
What's your definition of "nearest"?
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.
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.
Re: Searching Keywords for MS ACCESS
Whats with that? I was just describing what It supposed to look like. I gave already examples.
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?
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.
Re: Searching Keywords for MS ACCESS
Re: Searching Keywords for MS ACCESS
Quote:
Originally Posted by
CVMichael
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.
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
http://img88.imageshack.us/img88/8541/screeniev.png
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.
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
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?
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
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.