473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Combobox Search and Select

See the attached ms access file.
I have one combobox I want to search and select a keyword in it. usually combobox give u facility of one keyword which start with. for example I want to see the word "Water" if I type "Water" in combobox it give all the records which have word "Water" anywhere start, between ot end. and I need to select in the searched item record.

how can I do it plz help.
Attached Files
File Type: zip testdb.zip (103.3 KB, 914 views)
Nov 21 '12 #1
20 12462
Seth Schrock
2,965 Expert 2GB
As a general rule, the experts here don't open attachments from new people unless they ask for it. If you could provide the row source (in the properties window) of the combobox, we could probably figure it out from there. If it is just the name of a query, please post the SQL code from the query.
Nov 21 '12 #2
TheSmileyCoder
2,322 Expert Mod 2GB
AFAIK you cannot do that in a standard combobox. A workaround could be to have a listbox that shows result with a partial match, and let the user select from there.
Nov 21 '12 #3
Seth Schrock
2,965 Expert 2GB
Are you meaning that if you type in "wa" the only results are Water, Way, Watch, Etc. or that it just jumps to the "Wa" portion of the alphabet?
Nov 21 '12 #4
zmbd
5,501 Expert Mod 4TB
Respectfully, your question is actually very poorly worded and the details of a question should be posted (and if code formated using the <CODE/> button) rather than attached. Many of us do this in-between tasks at our regular jobs and as a matter of I.T. security either downloads are blocked or we simply don't download attachments in order to protect the network - absolutly nothing personal I assure you.
Something else to keep in mind is that pictures are often blocked by I.T. policies (I know at my work they are); thus, pictures are often not viewable.

As to your issue:

Which of the following do you want:
- Do you want a combobox where in the available entries in the dropdown portion of the combobox change/filter as the user types the entry.

- Do you want a record set that filters the records shown as the user types the entry into the textbox portion of the combo box while the dropdown list stays static.

- Do you want as Seth has described in #4, then set the ComboBox.AutoExpand Property to yes. As the user types into the textbox portion of the combobox then the first entry in the list that matches will start to show. The user can continue to type or can click on the dropdown and make make a selection from the neighboring entries.

- Or am I completely off track here and you are asking about something else entirely?
Nov 21 '12 #5
Sorry actually I m new user of this website. I just posted my first problem here
Let me explain you in details
I have a ComboBox. This Combobox has values from a table I this table I have names. By default when you type in combo box a some text only first match comes. let say if I type "Mathew" so only the Name start with Mathew comes other "Mathew" will not come. I want if I click on combobox key down only those names should come which have word "Mathew" either in beginning, middle or at the end.
hope my question is clear now
thanks all for responding.
Nov 22 '12 #6
Rabbit
12,516 Expert Mod 8TB
Wherever you're filtering the results, use the LIKE operator with wildcards instead of the = operator.
Nov 22 '12 #7
i used the like operator but it didn't solve the problem
Nov 22 '12 #8
Rabbit
12,516 Expert Mod 8TB
Did you put in the appropriate wildcards? It's hard to say whether you did it right or not when you don't post the code.
Nov 22 '12 #9
TheSmileyCoder
2,322 Expert Mod 2GB
To put it simply that is not how the combobox works, and there is no setting to modify to make it work like so.

There are workarounds such as pop-up forms, lookup forms and so, but none of them are simple to implement.

I would suggest you first take a step back and consider whether its a "nice to have" feature or a "need to have".

If this is something you need to have we may be able to guide you on the way, but don't expext anyone to just magic up a solution.
Nov 22 '12 #10
actually its "need to have" its a must have requirement
to use one combo box and in that combobox only those records come which have same keyword which you typed in compbobox
Nov 22 '12 #11
TheSmileyCoder
2,322 Expert Mod 2GB
Just to be 100% clear it is not possible. The combobox just doesn't function that way.

You will need to look at other ways to achieve it. You could use a textbox with a listbox being filtered as you type in the combobox. Another option could be a popup form with a textbox for typing the text and a means of displaying possible matches, with another means of selecting the match.
Nov 22 '12 #12
zmbd
5,501 Expert Mod 4TB
You didn't really answer the question I asked.
Please re-read it.


So let me get this straight....

You have a table say as follows:
Name: tbl_listforcbo[listforcbo_pk] - autonumber; [listforcbo_name] - text(50)
[1][alpha]
[2][ba]
[3][be]
[4][beet]
[5][beta]
[6][CitemwithBE]
[7][DitemBEwith]
(and yet more entries....)


This feeds your combo box control such as:
Name: cbo_listofnames
Record source:
SELECT[listforcbo_pk],[listforcbo_name]
FROM tbl_listforcbo

Number of columns: 2
Bound column: 1
Column Width: 0,1
(etc)

So now when you open your form named say "frm_example"
frm_example.cbo_listofnames appears first as an empty text box with a drop-down arrow button - Yes?
What other controls are on this form?
Is frm_example.cbo_listofnames acting as a filter for the details section showing records from another table?

From what little, information you've given and using the example I've given so far:
Now if the user clicks on the drop down button you see the entire list: [alpha], [ba], [be], [beet], [beta], etc...

If the user types in "B" in the text box and autoexpand is set to yes then "ba" shows up, if the user types "be" then nothing else shows up, if the user types "bet" then beta shows up... in each case if the user clicks on the drop down list, the user will see the entire list; however, the selection will be on the first item in list that contains the letters as typed in the order typed.

So good so far... and fairly much as you've described in #6

Instead of this behavior... what you appear to want is that when the user types in "be" and then clicks on the drip down button you want to see only:[be], [beet], [beta], [CitemwithBE], [DitemBEwith] in the list box portion of the combo box?

(BTW: this would be as I asked you in
Which of the following do you want:
- Do you want a combobox where in the available entries in the dropdown portion of the combobox change/filter as the user types the entry.
This actually sounds like a homework problem in an advanced design course and is something along the lines that Google does...

With that in mind I am going to ask you to:
Please post the code you've already tried.
Once copied and pasted, please format it using the <CODE/> button in the toolbar
Nov 22 '12 #13
NeoPa
32,556 Expert Mod 16PB
I'm guessing here, because frankly there is so little clear sense in this whole thread, but I think the OP wants a ComboBox control to work, not as it does, but to filter as you type such that only records that match what has been typed anywhere in the entry are included in the list.

This is clearly not something a ComboBox, or any other provided control, does naturally, or can easily be engineered to do. After all, a ComboBox doesn't even filter by what's typed at all, but only selects entries according to the matching of the first characters as entered.
Nov 22 '12 #14
zmbd
5,501 Expert Mod 4TB
@NeoPa,
Oh Master NeoPa, forgive this Padwan-learner; however, as you've said, and as Master TheSmileyCoder, is what I am attempting to elicit from this Youngling - perhaps I do not clearly speak its language?

I suspect that yet some other Master has assigned this task to this Youngling as a punishment and I do not wish to interfere with such an assignment! And yet it is a cruel assignment so merely letting it walk off the cliff is also not desirable.

Now if the Youngling will post its code in a properly formatted code-block and answer the questions as ask perhaps we can instruct, clarify, and correct its work?
Nov 22 '12 #15
NeoPa
32,556 Expert Mod 16PB
And yet, if this young OP is walking towards the cliff edge and is ignoring the cries of warning from all around him, could it not be considered his responsibility only that he dashes his body on the rocks below?

With a great heart is necessary the wisdom to appreciate that theirs is not the responsibility for all the ills of the world, but only those that are put in its path to give it the opportunity of expressing itself. Be assured there will always be enough of those ;-)
Nov 22 '12 #16
by all of your answers i came to know that combo box can not do thies functionality of filtered text only. although i put following code
Expand|Select|Wrap|Line Numbers
  1. Private Sub listforcbo_name_Change()
  2.  
  3. Dim sql As String
  4. sql = "SELECT * FROM tbl_listforcbo " & _
  5.  "WHERE listforcbo_name Like '*" & strString & "*'"
  6. End Sub
but it didn't work
anyways please give me ideawhat i can do for this problem
what should i use instead of combobox
i want to give facility to the user that he can choose the particular record into combobox, listbox, textbox, wat he entered and choose according to it own choice
let say
i give you example of customer name
user want to choose all custmoers which have name "Mathew" either first name, middle name, or last name. he can choose any customer name and the value should be save there where he type the keyword.
hope you people will unerstnad my problem
thanks
Nov 22 '12 #17
what if i run a query in combobox click event the query run and i choose particuar field of my choice and after choosing the value from query it come to combobox
Nov 22 '12 #18
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

It most likely didn't work because you didn't define strString.
Nov 22 '12 #19
NeoPa
32,556 Expert Mod 16PB
Kashif,
If people that try to help you ask you for information then ignoring those requests is not a good way to go about ensuring you get help. Everyone can see that you have ignored half of the responses. Do you imagine people are stupid? Why waste time trying to help someone who cannot even be bothered to reply to those people who do try to help.

You're heading for the cliff edge and we're trying to shout warnings. If you walk over the edge though, only you are responsible.
Nov 22 '12 #20
zmbd
5,501 Expert Mod 4TB
by all of your answers i came to know that combo box can not do thies functionality of filtered text only. although i put following code
what should i use instead of combobox
i want to give facility to the user that he can choose the particular record into combobox, listbox, textbox, wat he entered and choose according to it own

Ahhh... Youngling you see now the error of your ways and you've returned to us from the darkside.... allow me to show you the power of:Filtering on a Form and the most awsome force of the Cascadeded Form Filtering

There are of course the ways of parent-child-subforms and other more powerfull methods of GUI that we can teach you; however, those become a new thread and new answers.
Nov 22 '12 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: SAN CAZIANO | last post by:
check required in a select how can i control if a combobox (a select) is not null (index is -1) or if index is 0 if the first element is for example a null value or simply a description of the...
4
by: Jan | last post by:
I am having problems trying to print a report based on a form. This is a search form only, no data input. There is a query that the form looks at, but then there are numerous comboxes that you...
3
by: Cillies | last post by:
Hi all, I was wondering if anyone knows how to manipulate combo boxes. What I want to do is as follows: - Two combo boxes 1st box contains = Interested, Not Interested 2nd box contains =...
4
by: Strahimir Antoljak | last post by:
Has anyone experienced problems with a combo box SelectIndex property? Is there a limit to the number of Items for a combo box? Namely, when I set programmatically ComboBox.SelectIndex...
1
by: jojowebdev | last post by:
I have been TRYING for a few days to get a *working* search of a select list (about 800 options in list). I have not found one that works for IE6. Here is what I *last* tried. I would appreciate...
4
by: Eric85 | last post by:
I have a question on how combo serach box work... i have a table call StudentInfo my Primary key is set to auto number (which is thier membership number) i want to be able to scan the...
1
by: Pascal Hagedorn | last post by:
Hello Alltogether, following problem is bugging me :) I am havin a Combobox where i can browse and select my articles. So far so good! Over the time my table "article" growed and now it is not...
1
by: Peter Herath | last post by:
i want to display results in a combo box when i select a value from another combo box. for an example i hav two tables called Project and Indicator... i want to select a project name and when i...
3
by: =?Utf-8?B?bWVtZWFk?= | last post by:
I have a combobox displaying the full name of a customer (e.g. John Smith) and would like to go to the LAST name whenever a user presses a key while on this combobox. I have looked at the...
4
by: bullfrog83 | last post by:
I have a form where a user can search for a person either by their id or by their name. To faciliate a search by id I have an unbound textbox (txtPeopleId) and for a search by name I have an unbound...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.