Second loop runs once and stops

Phelonius

New Member
The basic concept behind this code is that whenever it runs, the quantity from an element decreases and the quantity from the same element, but from a different array, increases. For whatever reason, the second while loop only runs once and stops. For example, if \[code\]total1 = 11\[/code\] and \[code\]total2 = 0\[/code\], the first time the code is executed, \[code\]total1 = 10\[/code\] and \[code\]total2 = 1\[/code\]. However after that, \[code\]total1 = 9\[/code\] and \[code\]total2 = 1\[/code\] and so on. Can anyone tell me what is wrong with my code? Any and all help would be appreciated.\[code\]<%count = 0do while NOT rs3.EOF if rs3("ITEM_NO") = itemnum then qtyArray(count) = qtyArray(count) - qtyreq end if if qtyArray(count) >= 0 and rs3("ITEM_NO") = itemnum then total1 = total1 - qtyreq end if count = count + 1 rs3.MoveNextlooprs3.MoveFirstpickcount = 0do while NOT rs3.EOF if qtyPick(pickcount) >= 0 and rs3("ITEM_NO") = itemnum then qtyPick(pickcount) = qtyPick(pickcount) + qtyreq total2 = total2 + qtyreq end if rs3.MoveNext pickcount = pickcount + 1loop%>\[/code\]
 
Back
Top