Student Evaluation on Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings,
I have a database that keeps track of students grades for a non-profit
training center. I have created an access database to track all of the
student's information and want to use the information to print certificates
for the students.

Basically, I have a report in which I calculate the student's final grade
from the individual tests. I want to create a field called StudentEvaluation
that converts the number grade into an Evaluative grade... ie, 93-100 =
Excellent, 85-92 = Good, etc.

I am certain this is relatively easy to do in VB, but I am not experienced
in programming and have not figured out a way to do it from the Access
interface. Any help would be appreciated.
 
Chris,

Indeed, it is very easy in VB! To verify for yourself, create a standard
module (or use an existing one if there is one), and paste the following
code:

Function Grade(Score As Integer)
Select Case Score
Case 93 To 100
Grade = "Excellent"
Case 85 To 92
Grade = "Good"
Case 70 To 84
Grade = "Fair"
Case 50 To 69
Grade = "Pass"
Case 0 To 49
Grade = "Fail"
Case Else
Grade = "Error: Score out of range"
End Select
End Function

You can easily adapt to your score ranges / Grades.

Now, in your report design, in the control where you want the grade
displayed, type the following in the control source property:

=Grade([ctlScore])

where ctlScore is the name of a control that holds the numeric score. You
can use any name as long as you change as appropriate in the formula. The
control with the score needs to be in the same report section; if you don't
want it displayed, just set its Visible property to No.

Note: User-defined functions like this one will work in any database object,
not just reports, so you could do the same in the report's recordsource
query, and get rid of the numeric score control in the report altogether.

HTH,
Nikos
 
Back
Top