Using Sums for Points

Mrsostrich

Registered User.
Local time
Today, 08:57
Joined
Sep 28, 2002
Messages
21
I have a report in which I total points for each pupil by using =sum([Points])

I now want to use that total to predict a grade using the following rules:

below 10 = U
10-18 = E
19 - 27 = D
28 - 26 = C
37 - 46 = A

Can I do it on the report? I've tried using switch, but seem to be having difficulties, which may just be syntax. Any other suggestions?

Thanks in advance
 
you could use a select case
Dim PointNo as long
Dim Grade as String
PointNo=the name of the text box holding sum([Points])

select case PointNo
Case 0 To 9
Grade="U"
case 10 to 18
Grade="E"
case 19 to 27
Grade="D"
case 28 to 36
grade="C"
case 37 to 46
Grade="A"
case else

end select

use the on print event for the section of the report Where you want the grade will appear
 
Solved it

I couldn't actually get that routine to work. Or at leaset, I couldn't work out how to get the result displayed, but it did give me an idea. I allocated a vartiable name of PointsNo to the sum function, and then used that in the switch function=Switch[PointNo]<10,"U",[PointNo],19,"E"..........) etc and it works perfectly

Thank you
 
access has many ways to accomplish the same thing,glad you
got it to work
 

Users who are viewing this thread

Back
Top Bottom