DSum reference in a report

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Baker

    #1

    DSum reference in a report

    Hi:

    At the bottom of a report, I wish to sum all the amounts that appear in a field called
    Discount$ that appears on the report. I am not doing this summing in the query that
    supports the report because I have sprinkled the discounts amount into every record, and
    it only applies in the totals summary for each invoice.

    In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I
    reference the field in the report (Group summry for the Invoices over a period) so that I
    sum ONLY those entries that appear n the report.

    The following is my attempt, and all I get is errors!


    =DSum([Discount$],[Reports]![RINV1Q1])

    Help Please


    John Baker
  • John Baker

    #2
    Re: DSum reference in a report footer

    I just realized I hadn't posted a critical piece of information:

    The field Discount $ is in a section of the report RINV1Q1 named "PO Key Footer". I think
    my problem is I am not certain how to refer to a filed in a FOOTER rather than in the main
    report.

    best and thanks in advance

    John baker



    John Baker <Baker.JH@Veriz on.net> wrote:
    [color=blue]
    >Hi:
    >
    >At the bottom of a report, I wish to sum all the amounts that appear in a field called
    >Discount$ that appears on the report. I am not doing this summing in the query that
    >supports the report because I have sprinkled the discounts amount into every record, and
    >it only applies in the totals summary for each invoice.
    >
    >In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I
    >reference the field in the report (Group summry for the Invoices over a period) so that I
    >sum ONLY those entries that appear n the report.
    >
    >The following is my attempt, and all I get is errors!
    >
    >
    >=DSum([Discount$],[Reports]![RINV1Q1])
    >
    >Help Please
    >
    >
    >John Baker[/color]

    Comment

    • Trevor Best

      #3
      Re: DSum reference in a report

      John Baker wrote:
      [color=blue]
      > Hi:
      >
      > At the bottom of a report, I wish to sum all the amounts that appear in a field called
      > Discount$ that appears on the report. I am not doing this summing in the query that
      > supports the report because I have sprinkled the discounts amount into every record, and
      > it only applies in the totals summary for each invoice.
      >
      > In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I
      > reference the field in the report (Group summry for the Invoices over a period) so that I
      > sum ONLY those entries that appear n the report.
      >
      > The following is my attempt, and all I get is errors!
      >
      >
      > =DSum([Discount$],[Reports]![RINV1Q1])
      >
      > Help Please
      >
      >
      > John Baker[/color]

      Where are you putting this sum?

      If on the report itself you only need:
      =Sum([Discount$])

      Note it's Sum() and not DSum()

      If it's something external to the report then DSum() will need to know
      the report's recordsource and any criteria if any that was applied to
      the report upon opening it but the simnplest way woulkd be to do the
      above Sum() on the report, name that textbox whatever "txtSum" then you
      can reference it like =Reports!RINV1Q 1!txtSum

      --
      Error reading sig - A)bort R)etry I)nfluence with large hammer

      Comment

      • John Baker

        #4
        Re: DSum reference in a report

        Trevor:

        When i use =sum([Discount$]) it selects all the entries from the query that supports the
        report. This isn't what I need. I need to ONLY pick up the entries that appear in the
        "Invoice FOOTER" for the report so that I can sum all the discount lines take over a
        period. This is where I am hung up.

        Sorry if I didn't make myself clear.

        Best

        John

        Trevor Best <nospam@localho st> wrote:
        [color=blue]
        >John Baker wrote:
        >[color=green]
        >> Hi:
        >>
        >> At the bottom of a report, I wish to sum all the amounts that appear in a field called
        >> Discount$ that appears on the report. I am not doing this summing in the query that
        >> supports the report because I have sprinkled the discounts amount into every record, and
        >> it only applies in the totals summary for each invoice.
        >>
        >> In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I
        >> reference the field in the report (Group summry for the Invoices over a period) so that I
        >> sum ONLY those entries that appear n the report.
        >>
        >> The following is my attempt, and all I get is errors!
        >>
        >>
        >> =DSum([Discount$],[Reports]![RINV1Q1])
        >>
        >> Help Please
        >>
        >>
        >> John Baker[/color]
        >
        >Where are you putting this sum?
        >
        >If on the report itself you only need:
        >=Sum([Discount$])
        >
        >Note it's Sum() and not DSum()
        >
        >If it's something external to the report then DSum() will need to know
        >the report's recordsource and any criteria if any that was applied to
        >the report upon opening it but the simnplest way woulkd be to do the
        >above Sum() on the report, name that textbox whatever "txtSum" then you
        >can reference it like =Reports!RINV1Q 1!txtSum[/color]

        Comment

        • Trevor Best

          #5
          Re: DSum reference in a report footer

          John Baker wrote:[color=blue]
          > I just realized I hadn't posted a critical piece of information:
          >
          > The field Discount $ is in a section of the report RINV1Q1 named "PO Key Footer". I think
          > my problem is I am not certain how to refer to a filed in a FOOTER rather than in the main
          > report.
          >
          > best and thanks in advance[/color]


          You'd need some code to do that as no syntax in a control will do it.

          --- code start (air code) ---

          (declarations)
          Private mcurDiscountTot As Currency

          Sub PO_Key_Footer_P rint()
          mcurDiscountTot = mcurDiscountTot + Me![Discount$]
          End Sub

          Sub Report_Footer()
          Me!MyGrantTotal = mcurDiscountTot
          End Sub
          --- code end ---

          The two subs would be event procedures, the names and parameters may be
          slightly different from above.

          --
          Error reading sig - A)bort R)etry I)nfluence with large hammer

          Comment

          Working...