Re: Totalling a field that lives on a report only
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Thu, 29 Jun 2006 18:49:07 -0500
I missed the part about the total per school. This is very
difficult to do without having the calculation in a query.
For just two schools, identified on your form, you can do it
with two running sum text boxes named txtRunSchool1 and
txtRunSchool2. The expressions would be:
=IIf(School=Forms!frmPrintRepts.txtSchool1, FinalPoints, 0)
This will not generalize to an arbitrary number of schools.
The general approach is to calculate everything in a query
that can be used in a subreport, but it appears you are
headed down a different road.
--
Marsh
MVP [MS Access]
Gina K wrote:
The sum works over the entire group, but I still can't seem to get a total.
per school (my report is not grouped on the field School, nor can it be,
because of the way I'm assigning the place and points value (a running sum
over a group)). I tried to assign the place value in a ranking query, but
that didn't allow me to assign places per group, only places per the entire
record set.
Any other suggestions? (As if you couldn't tell, I'm not very good at
this...)
"Marshall Barton" wrote:
Gina K wrote:
I just can?t seem to get my report to total correctly, perhaps I can?t even
do what I?m trying?
I have a report, rptMeet, here?s a sample record:
Place Athlete School Result FinalPoints
1 Jones JFK 12345 5
txtFinalPoints is calculated:
IIf(IsNull([OverridePts]),[txtCalcPts],[OverridePts])
OverridePts is entered in the table on a form and resides in the report?s
record source, qryMeetRpt
txtCalcPts comes from:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If ([Relay] = False) Then
Select Case txtPlace
Case 1
txtCalcPts = 5
Case 2
txtCalcPts = 3
Case 3
txtCalcPts = 1
Case Else
txtCalcPts = 0
End Select
Else
Select Case txtPlace
Case 1
txtCalcPts = 5
Case Else
txtCalcPts = 0
End Select
End If
I want to sum the txtFinalPoints field grouped on School (school parameters,
txtSchool1 and txtSchool2, are supplied by a form, frmPrintRepts).
Can someone point me in the right direction so that I can sum for School1
and School2 in the group footer section, even though the field I?m summing is
calculated only on this report, and doesn?t live anywhere else in my database?
Add another text box named txtRunPoints next to the final
points text box. Set its control source expression to
=FinalPoints (use the actual name of the final points text
box) and set its RunningSum property ot Over Group. Then
the group footer can display the total in a text box with
the expression =txtRunPoints
- Follow-Ups:
- Re: Totalling a field that lives on a report only
- From: Gina K
- Re: Totalling a field that lives on a report only
- References:
- Re: Totalling a field that lives on a report only
- From: Marshall Barton
- Re: Totalling a field that lives on a report only
- From: Gina K
- Re: Totalling a field that lives on a report only
- Prev by Date: Re: Report detail not displaying
- Next by Date: Re: Print report to non default printer
- Previous by thread: Re: Totalling a field that lives on a report only
- Next by thread: Re: Totalling a field that lives on a report only
- Index(es):
Relevant Pages
|