I'm running into a type mismatch while trying to pass data to a hidden field, or even write it out using response.write, and I don't understand why. The first block of code contains a listbox that populates from a database, the idea is that I want the selected option to assign to the hidden field for use in the next form.
<%
Set Rs = Server.CreateObject("ADODB.Recordset"
SQL = "SELECT DISTINCT deplist.department from depList"
Rs.Open SQL, deplist, 1,3
response.write "<select size=""1"" name=""Department1"">"
response.write "<option value=""Choose"">"
response.write "</option>"
do while NOT rs.eof
response.write "<option value='" & rs("department"
& "'>"
response.write rs("department"
response.write "</option>"
rs.MoveNext
loop
deptrue=1
response.write "</select>" & "</td>"
this following code block is the hidden field and where the type mismatch appears:
<%
if depTrue = "1" then
response.write rs("department"
& "the department"
%>
<input type="hidden" name="dep1Hidden" value="<% response.write rs("department"
%>">
<%
end if
%>
<%
Set Rs = Server.CreateObject("ADODB.Recordset"
SQL = "SELECT DISTINCT deplist.department from depList"
Rs.Open SQL, deplist, 1,3
response.write "<select size=""1"" name=""Department1"">"
response.write "<option value=""Choose"">"
response.write "</option>"
do while NOT rs.eof
response.write "<option value='" & rs("department"
response.write rs("department"
response.write "</option>"
rs.MoveNext
loop
deptrue=1
response.write "</select>" & "</td>"
this following code block is the hidden field and where the type mismatch appears:
<%
if depTrue = "1" then
response.write rs("department"
%>
<input type="hidden" name="dep1Hidden" value="<% response.write rs("department"
<%
end if
%>