Hi! I have the following table on a form that displays multiple rows -
<%Cmd = "SELECT * FROM Tbl_Orders WHERE OrderCcUser = '"&Session("UserSessionUserId")&"' AND OrderMarkedAsSubmit = 'No'"
SET RsReq = CreditCardDb.execute(Cmd)%>
<td align="left"><font face="Tahoma" size="2"><b><u>Orders Waiting For Submittal</u></b></font></td><br>
<table border="1">
<tr>
<td> <%=" "%></td>
<td align="center"><font face="Tahoma" size="2"><u>Total Amount</u></font></td>
<td align="center"><font face="Tahoma" size="2"><u>Action</u></font></td>
</tr>
<%DO WHILE NOT RsReq.Eof%>
<tr>
<td align="center"><input type="hidden" name="OrderId<%=lvCountingSubmit%>" value="<%=RsReq("OrderId")%>">
<td align="center"><font face="Tahoma" size="2"><%=FormatCurrency(RsReq("OrderTotalAmount"),2)%></font></td>
<td align="center"><input type="checkbox" name="ChkBoxSubmit_<%=lvCountingSubmit%>" value="Yes"><font size="2">Submit</font></td>
<%lvCountingSubmit = lvCountingSubmit + 1%>
<%RsReq.MoveNext%>
<%LOOP%>
</tr>
<!--CREATE TEXT FIELD THAT IS HIDDEN TO DISPLAY THE TOTAL NUMBER OF RECORDS IN THE TABLE-->
<input type="hidden" name="lvCountingSubmit" value="<%= (lvCountingSubmit - 1) %>">
</table><br><br>
When the user selects the update button I check to see if they selected the checkbox.
lvCounterSubmit = Request.Form("lvCountingSubmit") + 1
'FOR EACH RECORD IN THE TABLE, DELETE THAT RECORD
FOR x = 1 TO lvCounterSubmit
IF Request.Form("ChkBoxSubmit_" & x) = "Yes" OR Request.Form("ChkBoxSubmit_" & x) = "yes" THEN
CmdRsGetRecordTypes = "SELECT * FROM Tbl_Orders WHERE OrderId = '" & Request.Form("OrderId" & x) & "'"
Response.Write("CmdRsGetRecordTypes - "&CmdRsGetRecordTypes)
'SET RsGetRecordTypes = CreditCardDb.execute (CmdRsGetRecordTypes)
END IF
NEXT
The problem is that the response.write shows -
CmdRsGetRecordTypes - SELECT * FROM Tbl_Orders WHERE OrderId = '5, 1'
It should state -
CmdRsGetRecordTypes - SELECT * FROM Tbl_Orders WHERE OrderId = 5
I can't figure out how the ,1 is getting in there.
Any suggestions is greatly appreciated.
<%Cmd = "SELECT * FROM Tbl_Orders WHERE OrderCcUser = '"&Session("UserSessionUserId")&"' AND OrderMarkedAsSubmit = 'No'"
SET RsReq = CreditCardDb.execute(Cmd)%>
<td align="left"><font face="Tahoma" size="2"><b><u>Orders Waiting For Submittal</u></b></font></td><br>
<table border="1">
<tr>
<td> <%=" "%></td>
<td align="center"><font face="Tahoma" size="2"><u>Total Amount</u></font></td>
<td align="center"><font face="Tahoma" size="2"><u>Action</u></font></td>
</tr>
<%DO WHILE NOT RsReq.Eof%>
<tr>
<td align="center"><input type="hidden" name="OrderId<%=lvCountingSubmit%>" value="<%=RsReq("OrderId")%>">
<td align="center"><font face="Tahoma" size="2"><%=FormatCurrency(RsReq("OrderTotalAmount"),2)%></font></td>
<td align="center"><input type="checkbox" name="ChkBoxSubmit_<%=lvCountingSubmit%>" value="Yes"><font size="2">Submit</font></td>
<%lvCountingSubmit = lvCountingSubmit + 1%>
<%RsReq.MoveNext%>
<%LOOP%>
</tr>
<!--CREATE TEXT FIELD THAT IS HIDDEN TO DISPLAY THE TOTAL NUMBER OF RECORDS IN THE TABLE-->
<input type="hidden" name="lvCountingSubmit" value="<%= (lvCountingSubmit - 1) %>">
</table><br><br>
When the user selects the update button I check to see if they selected the checkbox.
lvCounterSubmit = Request.Form("lvCountingSubmit") + 1
'FOR EACH RECORD IN THE TABLE, DELETE THAT RECORD
FOR x = 1 TO lvCounterSubmit
IF Request.Form("ChkBoxSubmit_" & x) = "Yes" OR Request.Form("ChkBoxSubmit_" & x) = "yes" THEN
CmdRsGetRecordTypes = "SELECT * FROM Tbl_Orders WHERE OrderId = '" & Request.Form("OrderId" & x) & "'"
Response.Write("CmdRsGetRecordTypes - "&CmdRsGetRecordTypes)
'SET RsGetRecordTypes = CreditCardDb.execute (CmdRsGetRecordTypes)
END IF
NEXT
The problem is that the response.write shows -
CmdRsGetRecordTypes - SELECT * FROM Tbl_Orders WHERE OrderId = '5, 1'
It should state -
CmdRsGetRecordTypes - SELECT * FROM Tbl_Orders WHERE OrderId = 5
I can't figure out how the ,1 is getting in there.
Any suggestions is greatly appreciated.