Hi,
I have a query as shown below which gets called when a button is clicked. For each student i have subjects upto 12, which can be entered on form inside textboxes (txtSubj*).
stSql1 = "UPDATE [STUDENT] SET [STUDENT].[SUBJ 1] = (" & txtSubj1.Value & ") WHERE [STUDENT].StudentID = " & txtStudentId.Value & " "
I would like to make a single call for update query and iterated inside a for loop so that same query can be used for 12 subjects.
Is it possible to do this. I have tried something like this but not getting with it. Can any one please let me know on how to go about with this.
for subjIndex = 1 to 12
stSql1 = "UPDATE [STUDENT] SET [STUDENT].[SUBJ & subjIndex] = (" & (txtSubj & subjIndex.Value & ") WHERE [STUDENT].StudentID = " & txtStudentId.Value & " "
next subjIndex
I have a query as shown below which gets called when a button is clicked. For each student i have subjects upto 12, which can be entered on form inside textboxes (txtSubj*).
stSql1 = "UPDATE [STUDENT] SET [STUDENT].[SUBJ 1] = (" & txtSubj1.Value & ") WHERE [STUDENT].StudentID = " & txtStudentId.Value & " "
I would like to make a single call for update query and iterated inside a for loop so that same query can be used for 12 subjects.
Is it possible to do this. I have tried something like this but not getting with it. Can any one please let me know on how to go about with this.
for subjIndex = 1 to 12
stSql1 = "UPDATE [STUDENT] SET [STUDENT].[SUBJ & subjIndex] = (" & (txtSubj & subjIndex.Value & ") WHERE [STUDENT].StudentID = " & txtStudentId.Value & " "
next subjIndex