Hello all,
this is the code i have on beforeUpdate property of a form (record source of the form is a table called tblApplicant).
...the problem with the above code is that i get no value to me.total_score field.
Any ideas what might be wrong?
Thank you in advance.
this is the code i have on beforeUpdate property of a form (record source of the form is a table called tblApplicant).
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strSQL As String
Dim rs As DAO.Recordset
strSQL = "SELECT * FROM tblGrades " & _
"WHERE [RecordID] = " & Me.RecordID & ""
Set rs = CurrentDb.OpenRecordset(strSQL)
While Not rs.EOF
total = total + rs.Fields("total_score").Value
rs.MoveNext
Wend
'me.total_score is a field of the tblApplicant
Me.total_score = total / 5
Set rs = Nothing
End Sub
...the problem with the above code is that i get no value to me.total_score field.
Any ideas what might be wrong?
Thank you in advance.