Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2007
    Posts
    40

    Question Unanswered: SUM of a query in Report

    I have a report based on a query (Invoice). I want to add a SUM entry from another query but can't get it to work. I've tried =SUM([Queries].[Payments].[Amount]) and I've tried the same with ! instead of . but can't get it to work. What am I missing?

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Invoices and payments... I'd say the best answer for you is to use a sub-report for your payments, which is attached to your payments query. Then you can easily refer to your subreport's objects.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Dec 2007
    Posts
    40
    Hi ST
    I have made a subreport which listed all the payments and did the SUM. It also workout, using the starting balance, if any monies are outstanding or in credit. However the subreport is obviously on a different part of the report to the invoice totals and is being missed by customers. I want to refer the the "Outstanding" box (=[StartBal]-[TotalPaid]) from the subreport like this:

    Total Value £10.00
    Total VAT £ 1.75
    Invoice Total £11.75
    Balance Outstanding £3.00
    Total Amount Due £14.75

    I've tried making Balance Outstanding value =[Reports].[Balance].[Outstanding] but I just get (hash)NAME? (Weirdly I've just discovered the Hash key on my laptop is broken!). I thought maybe you can't refer to a subreport since that report is open within the main report. Am I wrong and if so how to I refer to this "Outstanding" entry?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    If your Outstanding entry is called txtOutstanding and your subreport is called subPayments, and so is the subreport object on your mainform then:

    =[subPayments].Form![txtOutstanding]

    I hope
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •