Hi Friends,
I need a help, I am making a project where I have to update the class database all at once,
I made a function where some values are passing to update,
It is updating the Database as well,
But the problem is all the database is updated with the very last given value,
I want to update a specific data at a time,
A loop is giving values to this function,
I tried a SUB as well,
My code is below please do help me,
Public Function Store_All(class As String, term As String, sub1 As String, sub2 As String, sub3 As String, sub4 As String, sub5 As String, sub6 As String, sub7 As String, sub8 As String, sub9 As String) As String
If class = "Nursery" Then
If term = "1st" Then
conn.Execute ("Update Class_Nursery set subj1T1 ='" & sub1 & "',subj2T1='" & sub2 & "',subj3T1='" & sub3 & "',subj4T1='" & sub4 & "',subj5T1='" & sub5 & "',subj6T1='" & sub6 & "',subj7T1='" & sub7 & "',subj8T1='" & sub8 & "',subj9T1='" & sub9 & "';")
rec.Requery
ElseIf term = "2nd" Then
conn.Execute ("Update Class_Nursery set subj1T2 ='" & sub1 & "',subj2T2='" & sub2 & "',subj3T2='" & sub3 & "',subj4T2='" & sub4 & "',subj5T2='" & sub5 & "',subj6T2='" & sub6 & "',subj7T2='" & sub7 & "',subj8T2='" & sub8 & "',subj9T2='" & sub9 & "';")
rec.Requery
ElseIf term = "Final" Then
conn.Execute ("Update Class_Nursery set Subj1 ='" & sub1 & "',Subj2='" & sub2 & "',Subj3='" & sub3 & "',Subj4='" & sub4 & "',Subj5='" & sub5 & "',Subj6='" & sub6 & "',Subj7='" & sub7 & "',Subj8='" & sub8 & "',Subj9='" & sub9 & "';")
rec.Requery
Else
MsgBox "Select the Exam Term", vbInformation, "Term missing"
End If
End function