Results 1 to 4 of 4
  1. #1
    mattc66 is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2021
    Posts
    3

    iif statement help change to yes or no or a check box.

    Hi All - new here so be kind.


    I am trying to set the cell that if it doesn't have an OrderNum then the field is says NO. However when I run it - it shows NO on every line.

    Room: IIf(IsNull([OrderNum])=Null,Null,"NO")
    Background I have two tables. One with all Orders and one with Orders that contain a product called Rooms. I want a list that shows all the orders and column that has a NO (ideally a check box if it has a room). but I couldn't find a way to do a positive. So I figured I'd just not all orders without a room on the order show "NO".

    Thanks in advance.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Nothing equals null, not even null. You can only test for null or set a field to null. You also seem to have the options backwards, which would explain why every field became NO.
    Try
    IIF(IsNull([OrderNum]),"NO",[OrderNum]))
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    mattc66 is offline Novice
    Windows 10 Office 365
    Join Date
    Apr 2021
    Posts
    3
    IIF(IsNull([OrderNum]),"NO",[OrderNum])) That work but had to remove one parentheses IIF(IsNull([OrderNum]),"NO",[OrderNum]) Thank You.

    Is it possible to just show a check box with a
    check if its not null and uncheck if is null?

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Whoops, mis-counted my parentheses. You can set a checkbox to Yes/No, True/False, -1,0 depending on the table field format property setting.
    If the controls are bound to a field and a field is null, the checkbox state depends on the TripleState property. If False, Null shows as No. If True, No is unchecked, Null is dimmed and Yes is checked.
    Last edited by Micron; 04-03-2021 at 01:05 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Check box to if statement issues
    By wlkr.jk in forum Programming
    Replies: 3
    Last Post: 07-30-2014, 05:41 AM
  2. Replies: 5
    Last Post: 06-26-2014, 12:52 PM
  3. Using Check boxes for an if statement
    By brow1726 in forum Forms
    Replies: 3
    Last Post: 06-10-2013, 09:50 PM
  4. Replies: 5
    Last Post: 07-17-2012, 12:18 PM
  5. Check my Select Statement in Form
    By OMGsh Y did I say Yes in forum Forms
    Replies: 12
    Last Post: 12-07-2010, 02:13 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