I already input grades for the first student and the all grade information will save in the database. but when i'm trying to input grades for the other student i can't save the grade but there is no error shown.
Private Sub cmdSave_Click()
On Error Resume Next
If Val(txtcount.Text) = 0 Then
Text(1).Enabled = False
If Me.AdodcGrade.Recordset.EOF = True Then
With AdodcGrade
.Recordset.AddNew
.Recordset.Fields("Fullname") = lblStudent.Caption
.Recordset.Fields("Periodical") = txtPer.Text
.Recordset.Fields("Art") = Text(0).Text
.Recordset.Fields("English") = Text1(0).Text
.Recordset.Fields("Filipino") = Text2(0).Text
.Recordset.Fields("Hekasi") = Text3(0).Text
.Recordset.Fields("Math") = Text4(0).Text
.Recordset.Fields("Music") = Text5(0).Text
.Recordset.Fields("PE") = Text6(0).Text
.Recordset.Fields("Science") = Text7(0).Text
.Recordset.Fields("Total") = Text8(0).Text
.Recordset.Update
.Refresh
.Refresh
Form2.Adodc1.Refresh
End With
If Me.AdodcRec.Recordset.EOF = True Then
With AdodcRec
.Recordset.AddNew
.Recordset.Fields("Fullname") = lblStudent.Caption
.Recordset.Fields("1st") = Text8(0).Text
.Recordset.Fields("2nd") = Text8(1).Text
.Recordset.Fields("3rd") = Text8(2).Text
.Recordset.Fields("4th") = Text8(3).Text
.Recordset.Fields("Total") = txttotalGen.Text
.Recordset.Fields("Gen_Average") = txtTotalAverage.Text
.Recordset.Update
.Refresh
.Refresh
Form2.Adodc2.Refresh
End With
End If
End If
MsgBox "Save"
ElseIf Val(txtcount.Text) = 1 Then
If Me.AdodcGrade.Recordset.EOF = True Then
With AdodcGrade
.Recordset.AddNew
.Recordset.Fields("Fullname") = lblStudent.Caption
.Recordset.Fields("Art") = Text(1).Text
.Recordset.Fields("English") = Text1(0).Text
.Recordset.Fields("Filipino") = Text2(0).Text
.Recordset.Fields("Hekasi") = Text3(0).Text
.Recordset.Fields("Math") = Text4(0).Text
.Recordset.Fields("Music") = Text5(0).Text
.Recordset.Fields("PE") = Text6(0).Text
.Recordset.Fields("Science") = Text7(0).Text
.Recordset.Update
.Refresh
End With
MsgBox "Save"
End If
ElseIf Val(txtcount.Text) = 2 Then
If Me.AdodcGrade.Recordset.EOF = True Then
With AdodcGrade
.Recordset.AddNew
.Recordset.Fields("Fullname") = lblStudent.Caption
.Recordset.Fields("Art") = Text(2).Text
.Recordset.Fields("English") = Text1(0).Text
.Recordset.Fields("Filipino") = Text2(0).Text
.Recordset.Fields("Hekasi") = Text3(0).Text
.Recordset.Fields("Math") = Text4(0).Text
.Recordset.Fields("Music") = Text5(0).Text
.Recordset.Fields("PE") = Text6(0).Text
.Recordset.Fields("Science") = Text7(0).Text
.Recordset.Update
.Refresh
.Refresh
End With
MsgBox "Save"
End If
ElseIf Val(txtcount.Text) = 3 Then
If Me.AdodcGrade.Recordset.EOF = True Then
With AdodcGrade
.Recordset.AddNew
.Recordset.Fields("Fullname") = lblStudent.Caption
.Recordset.Fields("Art") = Text(3).Text
.Recordset.Fields("English") = Text1(0).Text
.Recordset.Fields("Filipino") = Text2(0).Text
.Recordset.Fields("Hekasi") = Text3(0).Text
.Recordset.Fields("Math") = Text4(0).Text
.Recordset.Fields("Music") = Text5(0).Text
.Recordset.Fields("PE") = Text6(0).Text
.Recordset.Fields("Science") = Text7(0).Text
.Recordset.Update
.Refresh
End With
MsgBox "Save"
End If
End If
End Sub