ASP Source Code:
<%Option Explicit%>
<!--#include file="ADOsetup.inc"-->
<HTML>
<HEAD>
<%
DIM strSQL, strID, strTemp, sel, opt, strVal
strID = Request.QueryString("ID")
IF strID = "" THEN strID = "0"
strSQL = "Select * FROM tblTTDtasks WHERE fldID = " & strID
ADOrs.Open strSQL, ADOcn
SUB ShowOpt(UserName)
Response.Write("<option value=" & UserName)
IF strVal = UserName THEN
Response.Write(" selected=selected ")
END IF
Response.Write(">" & UserName & " </option>" & vbCrLf)
END SUB
SUB fmt(strCaption,strField)
strVal = ADOrs.Fields(strField).Value
Response.Write("<tr>")
Response.Write(vbTab & "<td width='20%'><B>")
Response.Write(strCaption)
Response.Write("</td></B>")
Response.Write("<td>")
SELECT CASE strField
CASE "fldTaskPriority"
Response.Write ("<select name=" & "'" & strField & "'>")
Response.Write ("<option value=1>1</option>" & vbCrLf)
Response.Write ("<option value=2>2</option>" & vbCrLf)
Response.Write ("<option value=3>3</option>" & vbCrLf)
Response.Write("</select>")
CASE "fldUser"
Response.Write("<select name=" & "'" & strField & "'>")
CALL ShowOpt("TBD")
CALL ShowOpt("Ken")
CALL ShowOpt("Dan")
CALL ShowOpt("Frank")
CALL ShowOpt("Other")
Response.Write("</select>")
CASE ELSE
Response.Write("<input type='Text' Name=")
Response.Write("'" & strField & "' ")
Response.Write("value='" & strVal & "'>")
END SELECT
Response.Write("</td>")
Response.Write("</tr>")
END SUB
%>
</HEAD>
<BODY>
<H2><img border="0" Height=40 src="KgLogo.gif">
Things To Do: <font color=Red>Editor<font color=Black>
<A HREF='Show.ASP'><img border="0" src="TTD.gif" width="35">
Show All</A></H2><BR>
<%
IF NOT(ADOrs.EOF) THEN
%>
<form action="Update.asp" method="get">
<table width="80%">
<%
Response.Write("<input type='Hidden' Name=")
Response.Write("'fldID' ")
Response.Write("value=" & ADOrs.Fields("fldID").Value & ">")
CALL fmt("Topic","fldTopic")
CALL fmt("Task","fldTask")
CALL fmt("Priority","fldTaskPriority")
CALL fmt("Status","fldStatus")
CALL fmt("User","fldUser")
CALL fmt("Cost","fldCost")
CALL fmt("Deadline","fldDeadLine")
CALL fmt("Details","fldDetails")
%>
</table>
<input type="submit" value="Submit Changes"><BR>
</form>
<%
ELSE
IF strID = "0" THEN strSQL = "No value passed for ID"
Response.Write ("Invalid Request: " & strSQL )
END IF
%>
<!--#include file="ADOclose.inc"-->
</BODY>
</HTML>