Hi
I have a form based on a table Membership
There are 2 fields in the table bitApproved and bitDeclined.
I want 2 radio buttons, Approve and Reject, the user being able to choose one or the other for each record displayed.
The user can then run an update button, which looks for any values of 1 or 2 and performs a SQL update statement.
I have the following but
a) approve and reject can't be selected for each row - just once overall
b) the submit button is working but not running the SQL statement
thanks
ian
sqlstmt = "Select * from Membership where MB_GROUP = 10"
If Request.QueryString("order") <> "" Then
sqlstmt = sqlstmt & " ORDER BY " & Request.QueryString("order")
End If
Set objRS = objCon1.Execute (sqlstmt)
b = b & "<table border='1'>"
b = b & "<BR>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""13%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_ID""><font color=""#003399""><B>ID</a></B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""18%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_MEMBER""><font color=""#003399""><B>Organisation Name</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""54%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_EXTRA""><font color=""#003399""><B>Organisation Type</a></B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_EMAIL""><font color=""#003399""><B>Email Address</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_ADDR1""><font color=""#003399""><B>Address</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><font color=""#003399""><B>Approve</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><font color=""#003399""><B>Reject</B></font></FONT></td>"
b = b & "</tr>"
While Not ObjRS.EOF
b = b & "<FORM METHOD=""POST"" ACTION=""main.asp?page=540"">"
b = b & "<tr>"
b = b & "<td><a href=""main.asp?page=540&MB_ID=" & ObjRS("MB_ID") & """><font color=""000099"">" & ObjRS("MB_ID") & "</a></td>"
b = b & "<td>" & OBjrs("MB_MEMBER") & "</td>"
b = b & "<td>" & ObjRS("MB_EXTRA") & "</td>"
b = b & "<td>" & ObjRs("MB_EMAIL") & "</td>"
b = b & "<td>" & ObjRs("MB_Addr1") & "</td>"
b = b & "<TD><input type=""radio"" name=""rdbutton"" value=""1""><br>"
b = b & "<TD><input type=""radio"" name=""rdbutton"" value=""2""><br></tD></TD>"
b = b & "</tr>"
RowCount = RowCount + 1
ObjRS.MoveNext
wend
b = b & "</table>"
b = b & "<TD><TR><div align=""center""><center><p><input type=""submit"" name=""cmdAction"" VALUE=""Approve""></p></tr></TD>"
b = b & "</FORM>"
if Request.Form("cmdAction") = "Approve" then
if request.form("rdbutton") = 1 then
sqlupdate = "UPDATE membership set bitApproved = true where MB_ID = " & MB_ID & " "
response.write sqlupdate
elseif request.form("rdbutton") = 2 then
sqlupdate = "UPDATE membership set bitDeclined = true where MB_ID = " & MB_ID & " "
elseif request.form("rdbutton") = "" then
end if
objCon1.execute (sqlupdate)
end if
Set objRS = Nothing
Set objRS1 = Nothing
Set objCon = Nothing
Set objCon1 = Nothing
I have a form based on a table Membership
There are 2 fields in the table bitApproved and bitDeclined.
I want 2 radio buttons, Approve and Reject, the user being able to choose one or the other for each record displayed.
The user can then run an update button, which looks for any values of 1 or 2 and performs a SQL update statement.
I have the following but
a) approve and reject can't be selected for each row - just once overall
b) the submit button is working but not running the SQL statement
thanks
ian
sqlstmt = "Select * from Membership where MB_GROUP = 10"
If Request.QueryString("order") <> "" Then
sqlstmt = sqlstmt & " ORDER BY " & Request.QueryString("order")
End If
Set objRS = objCon1.Execute (sqlstmt)
b = b & "<table border='1'>"
b = b & "<BR>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""13%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_ID""><font color=""#003399""><B>ID</a></B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""18%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_MEMBER""><font color=""#003399""><B>Organisation Name</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""54%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_EXTRA""><font color=""#003399""><B>Organisation Type</a></B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_EMAIL""><font color=""#003399""><B>Email Address</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><a href=""main.asp?page=540&order=MB_ADDR1""><font color=""#003399""><B>Address</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><font color=""#003399""><B>Approve</B></font></FONT></td>"
b = b & "<td bgcolor=""#C0C0C0"" WIDTH=""15%""><font color=""#CC0000"" size=""2"" face=""Arial""><font color=""#003399""><B>Reject</B></font></FONT></td>"
b = b & "</tr>"
While Not ObjRS.EOF
b = b & "<FORM METHOD=""POST"" ACTION=""main.asp?page=540"">"
b = b & "<tr>"
b = b & "<td><a href=""main.asp?page=540&MB_ID=" & ObjRS("MB_ID") & """><font color=""000099"">" & ObjRS("MB_ID") & "</a></td>"
b = b & "<td>" & OBjrs("MB_MEMBER") & "</td>"
b = b & "<td>" & ObjRS("MB_EXTRA") & "</td>"
b = b & "<td>" & ObjRs("MB_EMAIL") & "</td>"
b = b & "<td>" & ObjRs("MB_Addr1") & "</td>"
b = b & "<TD><input type=""radio"" name=""rdbutton"" value=""1""><br>"
b = b & "<TD><input type=""radio"" name=""rdbutton"" value=""2""><br></tD></TD>"
b = b & "</tr>"
RowCount = RowCount + 1
ObjRS.MoveNext
wend
b = b & "</table>"
b = b & "<TD><TR><div align=""center""><center><p><input type=""submit"" name=""cmdAction"" VALUE=""Approve""></p></tr></TD>"
b = b & "</FORM>"
if Request.Form("cmdAction") = "Approve" then
if request.form("rdbutton") = 1 then
sqlupdate = "UPDATE membership set bitApproved = true where MB_ID = " & MB_ID & " "
response.write sqlupdate
elseif request.form("rdbutton") = 2 then
sqlupdate = "UPDATE membership set bitDeclined = true where MB_ID = " & MB_ID & " "
elseif request.form("rdbutton") = "" then
end if
objCon1.execute (sqlupdate)
end if
Set objRS = Nothing
Set objRS1 = Nothing
Set objCon = Nothing
Set objCon1 = Nothing