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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUM not working in report header

Status
Not open for further replies.

oneleaf5

Technical User
Nov 17, 2005
11
0
0
US
I have a report for work that lists the survey responses for each of our Conference workshops.
Information about each workshop is displayed in the Report Header.

Also in the Report Header are the total ratings the workshop received, ranging from 1 to 5.
These totals are acquired from DLookUp expression in textboxes named "txt1", "txt2", "txt3", "txt4", "txt5" respectively. The DLookUp expression for txt1 is thus:
=DLookUp("[1]","[qryCrosstab_SessionA]","[Class]=" & [SessionA_c])

I now need to calculate the Average rating. I want to find the overall totals of the ratings, and divide that number by the total responses. In the Report Header, I have 5 more invisible textboxes named "txt1Total", "txt2Total", "txt3Total", "txt4Total", "txt5Total" each with the expression: =Sum([txt1]), ect. The expression in my AverageRating textbox is thus: =([txt1Total]+[txt2Total]+[txt3Total]+[txt4Total]+[txt5Total])/[txtTotalResponses]

This is where the report blows up. When I run the report, I get the pop-up dialogue "Enter Parameter Value" for each "txt1", "txt2", "txt3", "txt4", "txt5". However, in trying to tweak and resolve this, instead of =Sum([txt1]) for "txt1Total" I've tried =Abs([txt1]) (just for fun) and the report runs without displaying the "Enter Parameter Value" pop-ups.

So it appears that my report is not responding to the =Sum([txt1]) expression in the header of the report, and I don't know why. I've tried moving these textboxes to the detail section or to the grouping footer, but the same "Enter Parameter Value" action occurs.

Can anybody tell me why this is happening? I guess for a solution I could use more DLookUp expressions tied to a Sum query, but I was hoping to code the calculation directly into the report.

many thanks,

onelaugh
 
Okay -- I got it.

Instead of =Sum([txt1]), what I needed to do was

=Abs(1*([txt1]))
=Abs(2*([txt2]))
=Abs(3*([txt3]))
=Abs(4*([txt4]))
=Abs(5*([txt5]))

Everything runs fine, and the average rating for each workshop is correct.

onelarf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top