I want my Question Set (and accompanying textboxes) to display when the user enters "Edit". This stuff was showing up before; it does not do so now and I have no idea what I did. I have a clue it is somewhere within the SQL statement, but not sure where.
Code:
ReportDataID=trim(Request.QueryString("ReportDataID"))
strSQL="SELECT tblReports.*, tblReportData.* " & _
"FROM tblReports, tblReportData " & _
"WHERE tblReports.ReportID=tblReportData.ReportID " & _
"AND tblReportData.ReportDataID=" & ReportDataID
rst.Open strSQL, cxn
if trim(Request.QueryString("exist"))<>"" then
Response.Write "<font color='red'><b>You selected an existing report, which has been loaded below</b></font>"
end if
'HEADER -- THIS STUFF PRINTS FINE
Response.Write "<h2>" & Request("UserName") & " - " & rst("Title") & "</h2>"
Response.Write "<h3>Applicant: " & rst("Applicant") & "</h3>"
rst.Close
strSQL="SELECT tblQuestions.QuestionID, tblQuestions.Question, " & _
"tblQuestionData.QuestionDataID, tblQuestions.DataTypeID, " & _
"tblQuestionData.Value " & _
"FROM tblQuestions, tblQuestionData " & _
"WHERE tblQuestionData.QuestionID = tblQuestions.QuestionID AND " & _
"tblQuestions.active = 1 " & _
"AND tblQuestionData.ReportDataID = " & ReportDataID &_
"ORDER BY tblQuestions.QuestionID"
rst.Open strSQL, cxn
'from here it does not print
Response.Write "<form action='Reporting.asp?op=Update' method='post'>"
Response.Write "<input type='hidden' name='reportDataID' value='" & ReportDataID & "'>"
Response.Write "<table>"
do until rst.EOF
Response.Write "<tr>"
Response.Write "<th align='left'>" & rst("Question") & "</th>"
Response.Write "<td align='left'>"
QID=trim(rst("QuestionID"))
Response.Write "<input type='hidden' name='QuestionDataID' value='" & rst("QuestionDataID") & "'>"
Response.Write "<input type='hidden' name='QuestionID' value='" & QID & "'>"
Value=FormatData(rst("Value"),rst("DataTypeID")) 'from formatfunctions.asp
Response.Write "<input type='text' name='QuestionData" & QID & "' value='" & Value & "'>"
Response.Write "</td>"
Response.Write "</tr>"
rst.MoveNext
loop
Response.Write "<tr><td colspan='2' align='center'><input type='submit' name='sent' value='Update Report'></td></tr>"
Response.Write "</table>"
Response.Write "</form>"
rst.Close