Results 1 to 5 of 5
  1. #1
    DPRapson is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2021
    Posts
    7

    2 Checkboxes, Only Show record if 1 or both are checked. Do Show record if Both unchecked.

    Hi All,



    I am new to the Forum and my Access knowledge fundamental at best.

    I would like to create a query with following criteria:

    The is query run on a Table [Lid]
    There are 2 Checkboxes: [BrdSek] and [OpBew] and both are unbound

    I would like the query to do the following:

    Only Show records that have one or both checkboxes checked. Do NOT show records if both checkboxes are unchecked.

    I tried cobbling a few expressions together without success.

    Can something like this work:

    Where([SekBrd]="False" Like [OpBew]="False" ? Do not how to complete the expression.


    Can someone please help?

    Thank you,

    Dave Rapson

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Not really enough info IMO. If the checks are unbound then the field data could be anything at all, so what is it? If it's actual text like "True" then you need the quotes and if not, you don't - and actual text data type for such a field would be an odd approach. If it's simply a T/F or Y/N field then why not bind the controls to the fields? Also, if you're going to use form control references in a query you need the complete reference; something like Forms!frmMyForm.MyControl (where the latter two are your form and control names). Last for now, you must include conditional operands such as AND or OR in such an expression. You cannot write "something = False Like..." More like "something = False AND something Like..." and the bolded references must be repeated for each comparison.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Sorry, tables and queries are not spreadsheets. Fields in query must be either a native field from table or a calculation. Calculation can reference form controls.

    You need some way to filter records based on data. If you want to allow users to randomly pick and choose records, that is tricky and a fairly common topic.
    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.

  4. #4
    DPRapson is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2021
    Posts
    7
    Quote Originally Posted by Micron View Post
    Not really enough info IMO. If the checks are unbound then the field data could be anything at all, so what is it? If it's actual text like "True" then you need the quotes and if not, you don't - and actual text data type for such a field would be an odd approach. If it's simply a T/F or Y/N field then why not bind the controls to the fields? Also, if you're going to use form control references in a query you need the complete reference; something like Forms!frmMyForm.MyControl (where the latter two are your form and control names). Last for now, you must include conditional operands such as AND or OR in such an expression. You cannot write "something = False Like..." More like "something = False AND something Like..." and the bolded references must be repeated for each comparison.
    Thanks for your response Micron. I obviously underestimated the complexity of the requirement.

  5. #5
    DPRapson is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2021
    Posts
    7
    Quote Originally Posted by June7 View Post
    Sorry, tables and queries are not spreadsheets. Fields in query must be either a native field from table or a calculation. Calculation can reference form controls.

    You need some way to filter records based on data. If you want to allow users to randomly pick and choose records, that is tricky and a fairly common topic.
    Thank you June7VIP

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

Similar Threads

  1. Replies: 9
    Last Post: 04-09-2020, 04:15 PM
  2. Replies: 23
    Last Post: 05-04-2018, 04:50 AM
  3. Replies: 2
    Last Post: 04-19-2018, 03:51 PM
  4. Replies: 2
    Last Post: 03-14-2017, 02:48 AM
  5. Replies: 4
    Last Post: 03-02-2012, 08:41 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