Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DSum for Report Subtotal 1

Status
Not open for further replies.

SColbert

Technical User
Sep 25, 2003
49
0
0
US
I have a report where I'm using the following code in an unbound text box to try to arrive at a subtotal of Pledges Received for each golfer registered:

GolferPledgesReceived=DSum("[PledgeAmount]","qryPledgeStatus","[Received] = True" And "[GolferLastName] = '" & [GolferLastName] & "'")

PledgeAmount = currency
Received = Yes/No
The report is grouped by Golfer Last Name and the text box is placed in the Golfer Last Name footer.

I've got a text box for PledgeAmount in the GolferLastName footer that is subtotalling by golfer correctly. But right now, the amount in the GolferPledgesReceived text box is the total of all pledges for all golfers - whether or not Received is True.

Any/all assistance is GREATLY appreciated!
 
If the PledgeAmount field is in the report's record source then you might be able to use:

=Sum(Abs([Received])*[PledgeAmount])

This expression should work in any report or group header or footer (not page sections).

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Perfect - much simpler than I thought.
Many thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top