Forums

ASP

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:

&lt;form action="ControlStatus4.asp" method="post"&gt;
&lt;select name="SelectStatus" class="style1" id="SelectType" onChange="javascript:submitform()"&gt;
&lt;option&gt;Selection&lt;/option&gt;
&lt;%
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)
%&gt;
&lt;option value="&lt;%=rs1(0)%&gt;"
&lt;%
prova=rs1(0)
if (prova)=(selezione) then response.write " selected "
%&gt;


&gt;&lt;%=rs1.fields("Status"%&gt;&lt;/option&gt;
&lt;%
rs1.movenext
loop
rs1.Close
set rs1 = Nothing
%&gt;

&lt;/select&gt;
&lt;input type="hidden" name="IdMessage" value="&lt;%=RS("IDMessageBoard"%&gt;"&gt;
&lt;% response.write RS("IDMessageBoard" %&gt;
&lt;input name="Submit" type="image" src="images/skin/icon024.gif" width="16" height="16" border="0" alt="edit your status" title="go"&gt;

This form has sent to ControlStatus4.asp that it is:

&lt;%
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

%&gt;

&lt;body onLoad="window.alert('Status send')"&gt;

&lt;/body&gt;

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?

Reply to this topic