Calculating Grades in VBA

mykil

My Life is Boring
Local time
Today, 12:32
Joined
Aug 16, 2011
Messages
117
:banghead::banghead::banghead:
I'm creating a form which stores a grade of a student for specific subjects. What I wanted to do now is to have a textbox which will calculate the average grade of the student using VBA. For Example, The fields to be filled in are: MATH1, ENGLISH1, SCIENCE1, and the Textbox which will display the average grade from those subjects labelled as AVERAGE.

MATH1 = 89
ENGLISH1 = 88
SCIENCE1 = 80
AVERAGE = ??

Any help will much appreciated.

Thanks Much
 
This would use a subForm.
The master form shows the student info.
The sub form shows the grades list.
In the footer of the subForm, is a text box,
The source of the textbox= AVG(fields)
 
Your subjects should not be fields. The Results table would consist fields to indicate the Student, the Subject and the Grade. With this structure, the averaging can be done very efficiently by the database engine using an aggregate query.
 

Users who are viewing this thread

Back
Top Bottom