Got a problem which has had me scratching my head for an age now, and has defeated both my Computing Teacher & my ultra techie friend.
The following code is working perfectly till the last cell of the table it produces:
set rs=conn.execute("SELECT Predictions.[Match ID], Users.Username, Predictions.Week, Predictions.HPred, Predictions.APred, Predictions.Mark FROM Weeks INNER JOIN (Users INNER JOIN (Matches INNER JOIN Predictions ON Matches.[Match ID] = Predictions.[Match ID]) ON Users.Username = Predictions.User) ON (Weeks.Week = Predictions.Week) AND (Weeks.Week = Matches.Week) WHERE (((Predictions.Week)='" & week & "')) ORDER BY Users.Username, Predictions.[Match ID];") rs.movefirst total = 0 do until rs.eof = true username = rs("username") response.write "<tr><td>" & username & "</td>" ttotal = total + ttotal total= 0 do until rs("username") <> username or rs.eof = true mark = rs("mark") total = mark + total response.write "<td align=center>" & rs("HPred") & " - " & rs("APred") & "</td><td align=center>" & (mark) & "</td>" rs.movenext loop response.write "<td align=right>" & total & "</td></tr>" loop response.write"</table>" rs.close
It is the last "<td align=right>" & total & "</td></tr>" which isn't being written
This is my logic:
After the inner loop has written the final record set it should "movenext" onto a non-existant RS. This should mean that rs.eof = true and without there being a username to call on, a null value should not equal the value in the variable. Thus the inner loop should stop.
However the error in the title is instead thrown up regarding the "do until" line of the inner loop.
Any suggestion are most appreciated as this one has me flummoxed.