Results 1 to 2 of 2
  1. #1
    Newby is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    60

    iif statement where true I what all records

    In a query I have a nested iif statements where if "All" is selected I want all records. If "Income" or "Expense" is selected I want only those records. If I select "Income" or "Expense", I get the desired result, and if I select "All", I get a null result. Below is my formula.



    If([forms].[sourcesSelect].[Cbx_IncExp]="All","*",IIf([forms].[sourcesSelect].[Cbx_IncExp]="Income","Income",IIf([forms].[sourcesSelect].[Cbx_IncExp]="Expense","")))

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Personally I don't like that method. I'd have the combo box return Null for the "All" selection, and use this:

    http://theaccessweb.com/queries/qry0001.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Whaa? Why is this skipping my True If-Statement??
    By schulzy175 in forum Programming
    Replies: 3
    Last Post: 03-20-2018, 05:18 PM
  2. Replies: 2
    Last Post: 10-20-2015, 02:01 PM
  3. Replies: 7
    Last Post: 04-10-2014, 02:22 PM
  4. Replies: 7
    Last Post: 11-15-2013, 10:28 AM
  5. Replies: 7
    Last Post: 01-11-2012, 12:24 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