The two counters do not match. In the For ... Next loop, you used i starting with 0 to Request("chkCount"), but in the form, you placed iCount = iCount + 1 at the beginning of the While ... Wend loop. That means the starting number is 1 if iCount was initialized to 0. You may try to move iCount = iCount + 1 to the end of loop, which is before rs.MoveNext.