Results 1 to 4 of 4
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    What's wrong with this Criteria

    AFC_DIVW: IIf([HDiv]="AFC-E" And [HDiv]="AFC-N" And [HDiv]="AFC-
    S" And [HDiv]="AFC-W" And [HResults]="L",1,0)

    I have the following fields & data :
    [HDiv] can contain data as, “AFC-E” “AFC-N” “AFC-S” “AFC-W” “NFC-E” “NFC-N” “NFC-S” & “NFC-W”

    [HResutls] “W”, “L”

    [AFC_DIVW] IIf([HDiv]="AFC-E" And [HDiv]="AFC-N" And [HDiv]="AFC-
    S" And [HDiv]="AFC-W" And [HResults]="L",1,0)

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    No record can meet the criteria. No record will have all those values in HDiv field.

    Try OR instead of AND and parens around the OR terms.

    AFC_DIVW: IIf(([HDiv]="AFC-E" Or [HDiv]="AFC-N" Or [HDiv]="AFC-S" Or[HDiv]="AFC-W") And [HResults]="L",1,0)
    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.

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Hi, thanks for responding. The expression you sent me worked, but wasn’t what I anticipated. There’s another fld within the query which is involved. Please allow me to elaborate further on the fields above,

    [COLOR="#0000FF"] [RConf] “AFC” Or “NFC”
    [RDiv] “AFC-E” ”AFC-N” ”AFC-S” ”AFC-W ”NFC-E” etc.
    [HResutls] “W”, “L”

    - AFC_CFW: IIf([RConf]="AFC" And [HConf]="AFC" And [HResults]="W",1,0) “#ERROR” appears in Dataset View

    - AFC_CFW: IIf([RConf]="AFC" Or [HConf]="AFC" And [HResults]="W",1,0) “#ERROR” appears in Dataset View

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You don't show HConf as one of the 3 fields listed above the expressions. If that fields does not exist, that could result in the #ERROR.
    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.

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

Similar Threads

  1. VBA gone wrong with an if
    By Ruegen in forum Programming
    Replies: 2
    Last Post: 10-21-2013, 05:38 PM
  2. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  3. What's wrong!
    By khalid in forum Programming
    Replies: 15
    Last Post: 06-27-2011, 06:38 AM
  4. What is wrong with this IFF?
    By bburton in forum Reports
    Replies: 2
    Last Post: 03-16-2011, 10:42 AM
  5. What am I doing wrong?
    By brandon in forum Access
    Replies: 2
    Last Post: 08-03-2008, 10:26 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