YES/No Query Criteria

Posted on 2008-11-10
Last Modified: 2012-05-05
I Have a query.  I have four fields which are yes/no fields.  In the query I want to be asked to enter Y/N as to build the criteria ad-hoc.  So, I put [Enter Y/N] in the criteria and indeed it prompts me, however what do I enter in the box, as Y or N does not work nor 1 or 0 nor T or F?
Question by:Powerhousecomputing
    LVL 25

    Accepted Solution

    0 and -1, -1 for a yes
    LVL 77

    Expert Comment

    The only values that will work are -1 (True) and 0(False).

    Since this is not intuitive(!!) for the user  you have to work around it.

    There is an example of how to deal with it here...

    Author Comment

    Cool - are there any other options or are they the only?  it just seems odd to tell someone to put in -1 for a yes
    LVL 25

    Expert Comment

    if you use the workarounds as detailed above in the KB then you can easily workaround teh issue
    LVL 3

    Expert Comment

    Hope my answer helped you to solve your issue.
    Folder option setting are per user. Am not sure how to set it for all users.
    LVL 3

    Expert Comment

    sorry, wrong post.
    LVL 8

    Expert Comment

    You can try something like this: put it in the criteria box:

    IIf([Is he/she married (y/n)?]='y';-1;0)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now