Answer the question
In order to leave comments, you need to log in
[HELP] How to add all elements from the list with student id binding?
For the third day I can not figure out how to write a cycle for entering data from the list!
Now I can add one record to the table with student id, grade name and grade itself.
Private Sub save_marks_Click()
Dim strSQL As Variant
Dim criteriaSQL As String
criteriaSQL = " Insert Into marks(userid, finalgrade) values ('" & Me.student & "', '" & Me.mark & "')"
For Each strSQL In criteria.Column
strSQL = " Insert Into marks(criteriaid) values ('" & Me.criteria & "');"
CurrentProject.Connection.Execute(strSQL)
Next strSQL
MsgBox("Added!")
End Sub
But for the loop, you need to assign each line its own score (combobox). And here is the plug. The For Each next loop could not be compiled correctly, it constantly swears at the data type, but I don’t understand how to group them. Please help!
Answer the question
In order to leave comments, you need to log in
This is what I just wrote to you about. The approach is strange.
You change or add at one time - one entry. One. Why the hell writing them all?
We catch the after_update event of the combobox with ratings. And insert/update the record. One. Don't forget to check that the Grade, Subject, Student comboboxes are filled in.
This is if you really want the code. But the same thing can be done without any code at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question