Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Quote Originally Posted by June7 View Post
    Set 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.
    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.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    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.

  3. #18
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211
    Quote Originally Posted by June7 View Post
    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.
    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.

  4. #19
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Set 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.
    I put column count as 2 and width as 1:1

    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.

  5. #20
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Quote Originally Posted by SierraJuliet View Post
    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 link to post 21. I'll look at it.

  6. #21
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    Quote Originally Posted by June7 View Post
    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?
    thanks for the review link.
    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.

  7. #22
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    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

  8. #23
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419
    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.

  9. #24
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Quote Originally Posted by johnseito View Post
    I put column count as 2 and width as 1:1

    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.
    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.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Search box that shows result in Form
    By revvedmoto in forum Programming
    Replies: 16
    Last Post: 02-20-2014, 03:20 PM
  2. Replies: 3
    Last Post: 09-02-2013, 04:33 PM
  3. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  4. Replies: 1
    Last Post: 06-09-2012, 05:44 PM
  5. Replies: 3
    Last Post: 11-07-2011, 10:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums