Below is my code to add new records and iterate through, incrementing for each iteration. Can someone point out why it's not incrementing (or working in general for that matter)? Thanks!
<FORM NAME="frmDetail" ACTION="LDPurchOrd3.asp" METHOD="POST">
<%
dim count, i, j
if len(Request.form("count"
) then
count = cInt(count)
for i = 0 to count
if len(Request.Form("strCost"
& i) then
Response.Write Request.Form("strVenItemCd"
& i & "<BR>"
Response.Write Request.Form("strVenDesc"
& i & "<BR>"
Response.Write Request.Form("strUnits"
& i & "<BR>"
Response.Write Request.Form("strUM"
& i & "<BR>"
Response.Write Request.Form("strCost"
& i & "<BR>"
end if
next
count = count + 1
else
count = 0
end if
Response.Write "<table WIDTH=750>"
Response.Write "<tr>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Vendor Item Code</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Item Description</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Units</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Unit of Measure</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Cost</strong></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td><input TYPE='text' NAME='strVenItemCd'></td>"
Response.Write "<td><input TYPE='text' NAME='strItemDesc' MAXLENGTH='200'></td>"
Response.Write "<td><input TYPE='text' NAME='strUnits'></td>"
Response.Write "<td><input TYPE='text' NAME='strUM'></td>"
Response.Write "<td><input TYPE='text' NAME='strCost'></td>"
Response.Write "</tr>"
Response.Write "</table>"
i = 0
while i < count
Response.Write Request.Form("strCost"
if len(Request.Form("strCost"
& i) then
Response.Write "<td><input TYPE='hidden' NAME='strVenItemCd" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strItemDesc" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strUnits" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strUM" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strCost" & count & "'></td>"
end if
i = i + 1
wend
Response.Write "<td><input TYPE='hidden' NAME='count'></td>"
%>
<BR>
<INPUT TYPE="submit" NAME="btnAdd" VALUE="Add">
<INPUT TYPE="submit" NAME="btnDone" VALUE="Done">
</FORM>
<FORM NAME="frmDetail" ACTION="LDPurchOrd3.asp" METHOD="POST">
<%
dim count, i, j
if len(Request.form("count"
count = cInt(count)
for i = 0 to count
if len(Request.Form("strCost"
Response.Write Request.Form("strVenItemCd"
Response.Write Request.Form("strVenDesc"
Response.Write Request.Form("strUnits"
Response.Write Request.Form("strUM"
Response.Write Request.Form("strCost"
end if
next
count = count + 1
else
count = 0
end if
Response.Write "<table WIDTH=750>"
Response.Write "<tr>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Vendor Item Code</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Item Description</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Units</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Unit of Measure</strong></td>"
Response.Write "<td WIDTH='150' ALIGN='center'><strong>Cost</strong></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td><input TYPE='text' NAME='strVenItemCd'></td>"
Response.Write "<td><input TYPE='text' NAME='strItemDesc' MAXLENGTH='200'></td>"
Response.Write "<td><input TYPE='text' NAME='strUnits'></td>"
Response.Write "<td><input TYPE='text' NAME='strUM'></td>"
Response.Write "<td><input TYPE='text' NAME='strCost'></td>"
Response.Write "</tr>"
Response.Write "</table>"
i = 0
while i < count
Response.Write Request.Form("strCost"
if len(Request.Form("strCost"
Response.Write "<td><input TYPE='hidden' NAME='strVenItemCd" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strItemDesc" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strUnits" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strUM" & count & "'></td>"
Response.Write "<td><input TYPE='hidden' NAME='strCost" & count & "'></td>"
end if
i = i + 1
wend
Response.Write "<td><input TYPE='hidden' NAME='count'></td>"
%>
<BR>
<INPUT TYPE="submit" NAME="btnAdd" VALUE="Add">
<INPUT TYPE="submit" NAME="btnDone" VALUE="Done">
</FORM>