Results 1 to 8 of 8
  1. #1
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60

    Check box in query condition: is this possible?

    Hi Community,



    I have a search database that finds records based upon certain parameters. These parameters were confined to text boxes, until now. I have a check box that represents verification of a certain record. However, when I try to incorporate this check box into my query condition, it doesn't work as I had hoped.

    I am thinking this is because of the way I wrote the conditions for the check box (similar to my text boxes).
    like "*" & [Forms]![MainSearchForm]![cbverified] & "*"

    How could i re-write this to represent a check box?

    Thank you in advance,

    Wesley

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Check boxes are either true or false, so you would use equal - as long as the field being compared is also a Y/N datatype.

  3. #3
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60
    I have achieved some success. I can now select the 'verified' check box and it will show only verified records. When the box it unchecked, it still shows verified records, but now includes the unverified. So there is some progress, but it's not quite what I think it can be.

    Click image for larger version. 

Name:	verified.png 
Views:	10 
Size:	5.4 KB 
ID:	27955

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Well, that's because you are including all records that are set to True, regardless of what is selected on the form.

  5. #5
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60
    Fixed and functioning as hoped. For future searchees this is the criteria I used!
    Click image for larger version. 

Name:	verified.png 
Views:	8 
Size:	5.5 KB 
ID:	27956

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Why do still have that second line of criteria? Aren't you taking the value from the what the user selected on the form? And anyway, it is nonsencial, it says "or include every record".

  7. #7
    WesHarding is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    60
    I'm don't consider myself strong with Access, this was just trial and error to get the result I was trying to get. I am always looking to be educated on Access, and this was just something suggested in another forum on the internet.

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Maybe this will help. The checkbox that shows on the grid (such as the checkbox showing in post #5) is not the Verified checkbox from the form. That checkbox indicates whether the column is visible or not in the query execution results. If you notice, it's present for all fields in a query.

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

Similar Threads

  1. Need help with condition in a query
    By NightWalker in forum Queries
    Replies: 1
    Last Post: 09-30-2016, 01:18 PM
  2. autofill from with specific condition check
    By dhanesh.koshti in forum Access
    Replies: 3
    Last Post: 01-14-2014, 01:01 PM
  3. Add Query Based on if Condition
    By shakeelmscw in forum Queries
    Replies: 17
    Last Post: 01-18-2013, 02:35 AM
  4. If Condition Query in Access
    By Vishan in forum Queries
    Replies: 3
    Last Post: 10-30-2012, 12:05 PM
  5. Help with writing Query If Then Condition
    By taimysho0 in forum Queries
    Replies: 4
    Last Post: 01-20-2012, 06:09 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