I have variables Student1, Student2, Student3 and Student
I assign values to Student1, Student2 and Student3 on the run.
Before Inserting these values in database, I assign those values to Student Variable and then insert them in database, something like:
For i = 1 to 3
InsertData = "Student" & i
Next
Here, I am not able to pass the Values for Student1, Student2 and Student3 to Student variable. How Can i do this?
Thanks in advance
CODE:
Student1 = "abc"
Student2 = "def"
Student3 = "ghi"
i = 0
For i = 1 To 3
Set httpReq = New MSXML2.xmlhttp
httpReq.Open "POST", InsertDataURL, False
httpReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
InsertData = "Student" & i
httpReq.send InsertData
InsertData = ""
Set httpReq = Nothing
Next i
I think you just need to move the location of your vairable assignment to before you open the HTTP Request: