Results 1 to 9 of 9
  1. #1
    Amanda003 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    9

    "Search" either column in combo box?

    Hello all!



    I have a combo box in my form that has 3 columns, ID (hidden), Item# & Item Description. Right now I have to start typing the Item # for it to auto fill the field. I was wondering if there is a way that if I don't know the Item# off hand that I can "search" ie "Mailer?" I would like to be able to have it auto fill whether I type the number or text. I'm not sure if I am explaining this correctly so I have included a screen shot to help.

    Thank you in advance!
    Amanda
    Last edited by Amanda003; 04-18-2014 at 07:10 AM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Could have two comboboxes bound to the same field. One has Item# as the first visible field and other has ItemDescription as first. Use one or other for input.
    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. #3
    Amanda003 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    9
    I'm sorry, I am very new to Access and I'm not really understanding.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    What exactly is not clear? Having multiple controls bound to the same field is unusual but the only way I can see to easily accomplish what you want.

    Keep the one combobox you already have.

    Create another combobox next to it but switch the two fields in the RowSource sql.
    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.

  5. #5
    Amanda003 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    9
    To me, it doesn't make sense to have 2 combo boxes when all the information I want is in 1 box. I would like to be able to either start typing in either "10" or "Mail" in the same box.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Unfortunately, comboboxes and list boxes do not work that way, at least not without some significant VBA code.
    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.

  7. #7
    Amanda003 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    9
    Well, darn it. So say I combined the columns to where all the info was all in 1 column, would there be a way to type/search any part the entry for it to auto complete or would I have to start at the beginning of the entry like I do now?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,945
    Closest I have seen is VBA code that replicates the combobox AutoExpand in a textbox that allows instant filter/search of records as each character is typed. However, even in that case the character matching starts at beginning of value and applies on only one field. You essentially want to filter on either of two fields or the concatenated text of two fields.

    This would require VBA code to execute after each keystroke in the box and requery the combobox RowSource using itself as the filter criteria in a wildcard expression. Never seen this although I expect the code would work. However, the results in continuous form will be unsatisfactory. Conditional comboboxes with alias don't work nice in continuous or datasheet view. This is because the filtering removes the record with alias value from the RowSource so records will appear blank in that field because the alias is not available for display.
    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.

  9. #9
    Amanda003 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    9
    That all went completely over my head but thank you for your responses! I personally have no problem with how the database works right now but there is someone else in the office that is never happy with anything so I thought I would ask but they can just deal with it.

    Thank you again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-14-2013, 06:29 AM
  2. Replies: 11
    Last Post: 06-18-2013, 07:48 AM
  3. Replies: 8
    Last Post: 03-05-2013, 01:20 PM
  4. Column sum works in "Detail" but not "Footer"
    By Doodlebug2000 in forum Reports
    Replies: 1
    Last Post: 12-10-2012, 03:20 PM
  5. Replies: 6
    Last Post: 07-25-2012, 06:42 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