Results 1 to 4 of 4
  1. #1
    ficky is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2018
    Posts
    1

    Search multiple fields using check boxes or option group

    I am using MS Access 2010 & 2016.


    It is my first time learning using MS Access and VBA. In the database, I did a search using SQL query with 1 text box searching 7 fields. Plus, I would like to try to search selected fields(one or more) using option group or check boxes. Additionally, there is "Enter parameter value" pop-up that I would like to get rid off.


    I can't seem to find any solution so I ask here. I really appreciate your help and thank you in advance.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    1 box for 7 fields:
    make 7 queries that use the text box.
    put all queries into 1 UNION query, run the union query
    or
    put all 7 into a macro, then run the mac to search 7 fields.

    the ENTER PARAM value is because your query has a field that does not exist, or a field misspelled, or an actual param in criteria.
    when this happens, the query will ask for a param.

    as for selecting 1 or more fields to search:
    either do a LOT of programming
    or
    just use a manual query design to do it yourself.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Your parameter prompt when opening the SearchForm is caused by the misspelled form name in the query for the subform (qry2018) - in the query you have Forms![Search]![txtSearch] but your form is called SearchForm. Your search in the 7 fields should work as you planned with the staggered criteria in the OR rows.


    Now for the other search you don't really give much info on how you want that to work. You could use the AfterUpdate events of the checkboxes and option group to apply (and remove) filters to subform (search this forum or google it on how to do that).

    Cheers,
    Vlad

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

Similar Threads

  1. Search TextBox with option group search group.
    By jhallcb in forum Programming
    Replies: 4
    Last Post: 03-23-2015, 07:40 PM
  2. Replies: 6
    Last Post: 02-26-2014, 05:06 PM
  3. Search records based on multiple check boxes
    By maytricks in forum Access
    Replies: 4
    Last Post: 01-14-2013, 07:26 PM
  4. Help with option group/check boxes?
    By bwest11 in forum Forms
    Replies: 3
    Last Post: 03-14-2011, 07:20 PM
  5. Replies: 3
    Last Post: 09-29-2010, 09:31 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