Results 1 to 3 of 3
  1. #1
    sud2017 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    148

    Calculated Textbox with Where statement

    Hi Experts,



    In the below calculated textbox formula in subform, I want to include some WHERE statement for a selected OppIF_FK (field in subform). In this case, for example, i want to calculate sum WHERE OppID_FK = 6. I am not too sure if it needs modifying the below formula or VBA code etc.?

    Your help will be greatly appreciated.

    =Sum(IIf([Currency]="USD",[OppDet_UnitCost]*[OppDet_Qty],0))+Sum(IIf([Currency]="CAD",[OppDet_UnitCost]*[OppDet_Qty],0))/[Parent].[Exchange]

    Thank you.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,894
    Perhaps just need to add criteria to the IIf()

    [Currency]="USD" AND [OppID_FK]=6

    [Currency]="CAD" AND [OppID_FK]=6
    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
    sud2017 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    148
    That worked great June7. Thank you very much!

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

Similar Threads

  1. Replies: 8
    Last Post: 10-29-2017, 07:55 PM
  2. Replies: 8
    Last Post: 06-09-2014, 01:14 PM
  3. If then statement on calculated field
    By blakej in forum Access
    Replies: 9
    Last Post: 03-17-2014, 01:12 PM
  4. Textbox calculated value to table
    By usselite in forum Forms
    Replies: 5
    Last Post: 04-09-2012, 09:31 AM
  5. Replies: 4
    Last Post: 06-29-2011, 06:32 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