Results 1 to 9 of 9
  1. #1
    bgarbage is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    5

    How to use Combobox to search in all columns

    Hello
    I have a table with id productName and a codeName
    example


    id productName codeName
    1 ProductOne myCode01

    I have also a form with a combobox that shows me the productName and I can choose from my list
    I would like also within the same combobox to be able to search by my codeName

    So if I type ProductOne to get my result but also if I type myCode1 to get the same result

    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Then you need 2 buttons.
    1 to search the NAME, 1 for the code.

    Depending on what you set your BOUND COLUMN to..
    if bound col = 2 the code,
    I would make a txt box to capure the unbound column NAME
    txtName = cboCode.column(1)


    clickng the btnByName would open the query that uses the txt box
    clicking the btnByCode would open the query that uses the comboBox

  3. #3
    bgarbage is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    5
    Hello,
    Thanks for your answer
    My problem is that the combobox is used to enter extra values in another table and one of them is the productName but it would be nicer to be able to search by name and by code too
    I don't want to have buttons on the form as the info are entered by rows on the comboxbox is only used to select the productName
    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Can't use one combobox. Could use two comboboxes.
    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
    bgarbage is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    5
    Hello
    I can't because of access limit or something else
    It would be nice to type into one combobox either information of two (or more) different columns and get the result
    Any ideas?
    Thanks again

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    What limit?

    I use a combobox to select field to search. This then sets the RowSource of second combobox with values from the selected field.
    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
    bgarbage is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    5
    Hello again
    I want one combobox to be able to search fro both field columns (productName and productCode)
    Is this possible?
    Thanks

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Well, if the combobox Limit to List property is set to No then user can type whatever they want (AutoExpand will only work with the BoundColumn values).

    Then query can have same filter parameter under multiple fields with OR operator.
    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
    bgarbage is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    5
    Thanks, I will try this and let you know

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

Similar Threads

  1. Combo Box Search from Multiple Columns
    By tdoolittle in forum Forms
    Replies: 1
    Last Post: 04-10-2014, 07:54 PM
  2. Replies: 2
    Last Post: 04-17-2013, 02:12 PM
  3. Replies: 1
    Last Post: 11-29-2011, 11:17 AM
  4. ComboBox not listing multiple columns
    By tylerg11 in forum Forms
    Replies: 3
    Last Post: 09-26-2011, 11:24 AM
  5. ComboBox with multiple columns
    By rkm360 in forum Forms
    Replies: 10
    Last Post: 05-14-2010, 01:19 PM

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