Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Nested iif

    FBal: IIf([Bal2]>0,Nz(DLookUp("bal2","SummaryTotalBalanceDlast2"," AppID = " & [AppID]),Nz(DLookUp("Bal3","SummaryTotalBalanceDFirst2"," AppID = " & [AppID]))))



    Can someone please help me with what's wrong with this? The first part works but the second brings nothing.
    Thx

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Try removing the spaces in front of AppID. Specify alternate value for the second Nz().

    FBal: IIf([Bal2]>0, Nz(DLookUp("bal2", "SummaryTotalBalanceDlast2", "AppID = " & [AppID]), Nz(DLookUp("Bal3", "SummaryTotalBalanceDFirst2", "AppID = " & [AppID]), 0)))


    If you want the first DLookup value if Bal2 is > 0 but the second DLookup if Bal2 <=0, end paren is out of place.

    FBal: IIf([Bal2]>0, Nz(DLookUp("bal2", "SummaryTotalBalanceDlast2", "AppID = " & [AppID]), 0), Nz(DLookUp("Bal3", "SummaryTotalBalanceDFirst2", "AppID = " & [AppID]), 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
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Nested iif

    SummaryTotalBalanceFINAL is the query that should show actual balances.

    Idea:
    If someone has paid part of the loan, their balance in the balances report(a query from SummaryTotalBalanceFINAL) should show the last balance(Endingbalance) after the last payment. But if someone hasn't paid anything, their balance should be the beginning balance.
    Thx
    Attached Files Attached Files

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The sample db doesn't open for me.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55
    Which office are you using?

  6. #6
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Nested iif

    Please See the new attachment.
    I have converted it to access 2007
    Thanks.
    Attached Files Attached Files

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Maybe it's me, but that won't open for me either. See if it will upload without zipping (compact-repair first).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The dB in Post #6 also will not open for me......

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Are you using Windows Compression to zip the file?
    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.

  10. #10
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55

    Nested iif

    Yes Please.
    If i dont compress its above 500kbs so it will not upload.
    See this one now and we see if it opens.
    thx
    Attached Files Attached Files

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Don't think I've ever had this much trouble, but that one won't open for me either. They all open as if I'd just started Access by itself.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Same here. Just opens Access app. Not even a 'cannot open' or 'not compatible' message.
    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.

  13. #13
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What version of Access are you using?
    Your tag line says you have A2003 - the dB should be a MDB.
    When I extract the file from the zip, it has an accdb extension.

  14. #14
    dref is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    55
    How about if you opened access, create a new db and then import into the new db?
    It might work that way.

  15. #15
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Tried that yesterday before I posted.

    Once again:
    What version of Access are you using?
    Your tag line says you have A2003 - the dB should be a mdb extension.
    When I extract the file from the zip, it has an accdb extension.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. IIF With Nested IIF?
    By jo15765 in forum Queries
    Replies: 5
    Last Post: 08-08-2016, 06:41 AM
  2. Nested IF
    By balajigade in forum Queries
    Replies: 3
    Last Post: 10-04-2014, 10:23 AM
  3. nested iif
    By slimjen in forum Reports
    Replies: 1
    Last Post: 03-15-2014, 09:30 AM
  4. Nested IIF
    By Oldie in forum Queries
    Replies: 1
    Last Post: 02-17-2012, 06:04 AM
  5. Nested If statement
    By Bellablue in forum Access
    Replies: 7
    Last Post: 10-09-2011, 12:00 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