I am trying to insert several records into a table. The code is inserting the correct number of records, but it is entering the same data for each record. Could you guru's give me a hand with this code??
rsEntries.MoveFirst
Do Until rsEntries.EOF
For i = 1 To rsEntries("expr1")
Randomize
ranNum = Int((10000 - 1 + 1) * Rnd + 1)
strSQLInsert = "INSERT INTO table(RandomNumber, FName, LName, Phone, Email, Sponsor, Coordinator, [Month]) VALUES (" & ranNum & ", '" & strFname & "', '" & strLName & "', " & strPhone & ", '" & strEmail & "', '" & strExec & "', '" & strCoord & "', '" & strMonth & "')"
adoCon.Execute (strSQLInsert)
Next
rsEntries.MoveNext ///(I have tried to move this before the next, but does not work)
Loop
rsEntries.MoveFirst
Do Until rsEntries.EOF
For i = 1 To rsEntries("expr1")
Randomize
ranNum = Int((10000 - 1 + 1) * Rnd + 1)
strSQLInsert = "INSERT INTO table(RandomNumber, FName, LName, Phone, Email, Sponsor, Coordinator, [Month]) VALUES (" & ranNum & ", '" & strFname & "', '" & strLName & "', " & strPhone & ", '" & strEmail & "', '" & strExec & "', '" & strCoord & "', '" & strMonth & "')"
adoCon.Execute (strSQLInsert)
Next
rsEntries.MoveNext ///(I have tried to move this before the next, but does not work)
Loop