Results 1 to 4 of 4
  1. #1
    aaghd72 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    4

    Need to create a calculated field in a report footer section based on an IIF statement

    I have a "[strVendorName]" Footer section
    In that section I have a calculated text box: =Sum([curInvoiceTotal])
    Provides an invoice subtotal for each vendor's name
    In the Detail section there is a field generated from the query the report is based on
    Funding Code:[strAubrey/Providence]&""&[intFundingCode] which adds the letter A or P in front of the
    [intFundingCode] field.

    I would like to create a calculated field in the Report Footer that provides a grand total for all Funding Code's that begin with the letter A and a grand total for all the P Funding Codes as well.

    I tried creating a text box with this expression but it does not work: =IIF([intFundingCode]=a*,sum([intFundingCode],0

    If someone could please tell me how to get these grand totals, I would appreciate it. Thanks

  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,515
    How about something like this, if I have the fields right:

    =Sum(IIf([strAubrey/Providence] = "P", curInvoiceTotal, 0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aaghd72 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    4
    Paul, thank you very much. It's all about that syntax!

  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,515
    Happy to help and welcome to the site by the way!
    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. Replies: 2
    Last Post: 06-18-2018, 07:44 AM
  2. Replies: 2
    Last Post: 10-07-2016, 04:50 PM
  3. Replies: 2
    Last Post: 01-09-2014, 07:24 PM
  4. Replies: 6
    Last Post: 03-26-2013, 12:17 PM
  5. Replies: 26
    Last Post: 11-06-2009, 10:16 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