I am trying to use a collection in my code, and I'm seeing what appears to be some weird behavior which I can't explain. Essentially, I am adding values to a collection, and sometimes, the next line of code changes the first listing of the collection.
It's hard to explain in words, so I recorded a video (2 minutes) that shows what is happening.
I would be very curious if anyone has any explanation for what is going on. Right now, the rest of my code won't work because the first value in the collection is blank.
Here's the code seen in the video:
It's hard to explain in words, so I recorded a video (2 minutes) that shows what is happening.
I would be very curious if anyone has any explanation for what is going on. Right now, the rest of my code won't work because the first value in the collection is blank.
Here's the code seen in the video:
Code:
SQLstr = "SELECT * FROM qScores WHERE MemberID = " & MemberID & " ORDER BY TournamentDate DESC"
Set rstSCORES = db.OpenRecordset(SQLstr, dbOpenSnapshot)
If rstSCORES.RecordCount > 0 Then
rstSCORES.MoveLast
rstSCORES.MoveFirst
'This will loop through the recordset and record the scores in the collection.
Do While TheScores.Count < 10 And Not rstSCORES.EOF
TheScores.Add rstSCORES!Points
rstSCORES.MoveNext
Loop
End If