By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

DSum reference in a report

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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 <Ba******@Verizon.net> wrote:
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


Nov 12 '05 #2

P: n/a
John Baker wrote:
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


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!RINV1Q1!txtSum

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 12 '05 #3

P: n/a
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@localhost> wrote:
John Baker wrote:
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


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!RINV1Q1!txtSum


Nov 12 '05 #4

P: n/a
John Baker wrote:
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

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_Print()
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
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.