Forums
This topic is locked
selection drop down menu and update record
Posted 14 Dec 2005 05:46:56
1
has voted
14 Dec 2005 05:46:56 damiano gestri posted:
Hi, I've a message board and <font color=red>my obiective is that when an user receive a message, he can select from a drop down menu the status of this message</font id=red>. The status has taken from table Status(IdStaus and Status) on my Access db.The messages are write on table MessageBoard that it's made with this Fields: IdMessageBoard, IsStaff(connected to table Staff that contain all person in the staff), some text fields, and Staff(number) that is connect to Staff.IdStaff.
The code of the form where is the drop down menu' is:
<form action="ControlStatus4.asp" method="post">
<select name="SelectStatus" class="style1" id="SelectType" onChange="javascript:submitform()">
<option>Selection</option>
<%
sql1 = "SELECT Status.IdStatus, Status.Status FROM Status"
'sql1 = "SELECT Status.IdStatus, Status.Status, MessageBoard.IdMessageBoard FROM Status INNER JOIN MessageBoard ON Status.IdStatus = MessageBoard.Status;"
Set rs1 = Server.CreateObject("ADODB.Recordset"
rs1.Open sql1, conn ,3,3
Dim selezione
selezione = Request.Form("SelectStatus"
if selezione="" then selezione=0
dim prova
do while not(rs1.eof)
%>
<option value="<%=rs1(0)%>"
<%
prova=rs1(0)
if (prova)=(selezione) then response.write " selected "
%>
><%=rs1.fields("Status"%></option>
<%
rs1.movenext
loop
rs1.Close
set rs1 = Nothing
%>
</select>
<input type="hidden" name="IdMessage" value="<%=RS("IDMessageBoard"%>">
<% response.write RS("IDMessageBoard" %>
<input name="Submit" type="image" src="images/skin/icon024.gif" width="16" height="16" border="0" alt="edit your status" title="go">
This form has sent to ControlStatus4.asp that it is:
<%
dim idMessage
idMessage = trim(request.form("idMessage")
sql= "SELECT Status.IdStatus, Status.Status, MessageBoard.IdMessageBoard FROM Status INNER JOIN MessageBoard ON Status.IdStatus = MessageBoard.Status where IdMessageBoard = " & idMessage & ";"
'response.write (sql)
'response.end
Set RS2 = Server.CreateObject("ADODB.Recordset"
RS2.Open Sql, Conn, 2, 2
'RS.Find "IDMessage='" & request("IDMessageBoard" & "'"
Rs2("Status" = request.form("Status.IdStatus"
RS2.update
RS2.close
set RS2 = nothing
%>
<body onLoad="window.alert('Status send')">
</body>
I try if the correct IdMessageBoard arrive into Sql and it's ok.....
<font color=red>
The problem is that the Status field on MessageBoard Tables aren't update when I Make the submit of this form... </font id=red>
I Have this Error:
<font color=blue>
Error Type:
Response object, ASP 0185 (0x8002000E)
A default property was not found for the object.
/site/ControlStatus4.asp</font id=blue>
Can Someone HELP ME,please?