Results 1 to 3 of 3
  1. #1
    sam.eade is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    29

    Creating a Search Form using query

    Hi,



    I have created a table with a name field and then multiple boolean criteria fields and then created a query relating to these values in the table.
    I have then created a search form, where the user will check tick boxes and then hit a button which opens the query. (trying to be used as a search form)

    I have linked the fields in the query to the tick boxes using the criteria [Forms]![SearchForm]![TickBox1] to return values when the box is ticked and the value is Yes in the table.

    My PROBLEM is that if I tick one box, it will only return the records where ONLY that field is TRUE. Records are only returned when ALL of the values are matching.

    Is there a way to return a record if all of the search criteria are true, even if the record has many more fields as TRUE?

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I've never found a way to have dynamic query filter parameters on yes/no fields. I generally avoid dynamic queries of any kind. I use VBA to build filter criteria and apply filter to forms and reports.
    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
    sam.eade is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    29
    Hmmm, my solution (although not perfect) was to change all the tick boxes to triple state and set them as Null by default. Then changed all the criteria to Like "*" & [Forms]![SearchForm]![TickBox1] & "*". So the first search works great, had to add in a refresh button that users push between searches to set all the values back to null though.


    The problem arises if people who aren't familiar with it keep changing their minds because then boxes are set to false rather than null. It's got design flaws but I couldn't think of another way around it.

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

Similar Threads

  1. Replies: 21
    Last Post: 08-05-2013, 06:23 AM
  2. Creating a search form in access
    By fawadmz in forum Access
    Replies: 2
    Last Post: 10-15-2012, 12:48 AM
  3. Need help in creating Search Form
    By bnar in forum Forms
    Replies: 2
    Last Post: 06-05-2012, 12:09 AM
  4. creating a search form
    By foxtet in forum Forms
    Replies: 4
    Last Post: 08-06-2011, 06:08 AM
  5. Creating an Access Search Form
    By Icky_Joe in forum Forms
    Replies: 2
    Last Post: 08-16-2010, 11:33 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