I have the following code in ASP Classic:
<%
dim prac_id
prac_id = Request.Form("Practice_ID")
dim surname_id
surname_id = Request.Form("clientsurname")
If prac_id <> "" And IsNumeric(prac_id) AND surname_id <>"" then
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "claims","username","password"
strSQL = "SELECT * FROM (Claim_Status INNER JOIN PI_Agents ON Claim_Status.Agent_ID = PI_Agents.Agent_ID) INNER JOIN Statuses on Claim_Status.Status_ID = Statuses.Status_ID WHERE Practice_ID = '"&prac_id&"' AND Client_Surname LIKE '%" & surname_id & "%'"
set rs = Conn.Execute (strSQL)
%>
<html>
<head>
<title>PI Accepts - Results</title>
</head>
<body>
<a href="default.asp" title="Home Page">Home Page</a>
<form method="POST" action="result.asp" name="form1">
<td width="10">
<select name="Practice_ID" size="1" ID="Prac">
<option value="0">Select Practice</option>
<option value="1">HCL</option>
<option value="2">Silverbeck</option>
<option value="3">TPF</option>
<option value="4">Express</option>
</select>
</td>
<p> Client Surname </p>
<input type="text" name="clientsurname" value="" />
<tr>
<td> </td>
<td colspan="2"><input type="submit" name="Submit" value="Submit"></td>
</tr>
</form>
<table border="1">
<form>
<tr><th>Claim ID</th><th>Date</th><th>Agent</th><th>Client First Name</th><th>Client Surname</th><th>Client Number</th><th>Current Status</th><th>Accepted</th><th>Rejected</th></tr>
<% DO WHILE NOT rs.EOF %>
<tr><td><% Response.Write rs("ID_Ref") %></td><td><% Response.Write rs("Date_Passed") %></td><td><% Response.Write rs("Agent_Name") %></td><td><% Response.Write rs("Client_First_Name") %></td><td><% Response.Write rs("Client_Surname") %></td><td><% Response.Write rs("Main_Number") %></td><td><% Response.Write rs("Status") %></td>
<td><input type="checkbox" name="accepted" id="<%= rs("ID_Ref")%>" value="1"></td><td> <input type="checkbox" name="rejected" id="<%= rs("ID_Ref")%>" value="2"></td><td><input type="submit" name="editclaim" value="Submit"></td></tr>
</form>
<%
rs.MoveNext
Loop
%>
</table>
if request.form("accepted") <>""then
update Claim_Status SET Status_ID=1 WHERE ID_Ref=
<%
conn.Close
Set conn = Nothing
End IF
%>
</body>
</html>
What I'm trying to do is, using the two checkboxes (accepted and rejected), if one of these is selected and 'Submit' is pressed, then it returns the value (either 1 for accepted or 2 for rejected) to the column 'Status_ID' in the 'Claim_Status' table where the ID_Ref of the claim being selected matches the ID_Ref of the claim in the database (e.g, if Smith is searched for and it brings up for claims numbered 1,2,3,4 and someone picks the one numbered 3, then it'll only update that one on the database)
The page works fine and the checkboxes appear OK (they both need to be unticked when page first displays) but I cant quite figure out the last bit of coding to get the status to update based on the relevant checkbox being ticked.
Any help appreciated...Thanks!!