I use a combo box like that for specific things frequently and it works but I have a feeling the OP is wanting more of a google search type of thing for inventory or music.
Review
http://allenbrowne.com/ser-32.html
http://allenbrowne.com/AppFindAsUType.html
http://allenbrowne.com/ser-62.html
A combobox really incorporates the best of textbox and listbox.
And why open listbox on a different form?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
The OP might want to increase field sizes to accommodate longer strings instead of cutting off data. Seems like data was migrated from somewhere. Any who, I agree setting AutoExpand, LimitToList, and Allow AutoCorrect works like a charm for most users to find what they need without messing things up.266 items is not very many. And since there are duplicates, the combobox list would actually be shorter with a RowSource of: SELECT DISTINCT List FROM tb;
Make sure combobox AutoExpand is set to Yes. Combobox will match item in list as user types if item exists, otherwise if LimitToList set to No they can type whatever they want.
What is purpose of the listbox?
Odd list, words cut off.
I put column count as 2 and width as 1:1Set combobox properties to display multiple columns in the dropdown.
ColumnCount: 2
ColumnWidths: 1";1"
The combobox can be referenced in wildcard search.
There really is no drawback to using combobox.
and the sql as in row Source
"SELECT a, b
FROM table
WHERE a like "*a*" or "*a" or "a*"
and I see the same. It didn't show two fields it just shows the first field.
Also more records may be added, including with different dates, now the user wants to select the specific dates and the records that falls within that date.
Thanks for the link to post 21. I'll look at it.See my post #21 here https://www.accessforums.net/showthr...t=69969&page=2
I know this works because I use it without an issue. You can do full or partial searches and the list box populates with what you want so long as you did the leg work and typed out the fields and tables into it.
thanks for the review link.Review
http://allenbrowne.com/ser-32.html
http://allenbrowne.com/AppFindAsUType.html
http://allenbrowne.com/ser-62.html
A combobox really incorporates the best of textbox and listbox.
And why open listbox on a different form?
I thought that might be elegant and because in the search form I have on top of the form
search by grouping by clicking on a button and it opens up a form that shows subform of everything in that category the user click on,
and on the bottom of the search form I have a search bar. I thought it would be awkward to have a search bar and then a listbox on the bottom as well.
So with the example of the list I have, the list belongs into 4 separate categories as well.
From your post #3 I thought you were basing the search on the query named query1.
If you want to use the table, just change the SRD form code as below in the sample DB from post #9:
Code:Private Sub Form_Current() Dim sSQL As String 'Debug.Print "openargs=" & OpenArgs sSQL = "SELECT tb.List FROM tb WHERE tb.List Like '*" & OpenArgs & "*'" 'Debug.Print sSQL LB.RowSource = sSQL End Sub
Last edited by davegri; 01-20-2018 at 11:31 PM. Reason: comment the debug.print
From your post #3 I thought you were basing the search on the query named query1.
If you want to use the table, just change the SRD form code as below in the sample DB from post #9:
Thank you, looks very nice and it works pretty well.
Widths property would be: 1";1". The dropdown should show both fields. Only one column will show in the box.
The WHERE clause needs only the first wildcard ("*a*"), however if you want all three, have to repeat the field.
WHERE a LIKE "*a*" OR a LIKE "*a" OR a LIKE "a*"
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.