dynamic drop down list box

liunx

Guest
Hi all,

I have the following form on one asp page:

<form action="officesearch.asp" method="POST">
Office: <select name="officesearch"><%do while not objrs.eof %><option value="off_name"><%=objrs("office_name")%></option><%objrs.movenext
loop
objrs.close
set objrs = nothing
objConn.close
set objConn=nothing
%> </select>
</pre>
<input type="Submit" name="" value="Submit"><br>
</form>

This calls this asp page:

SQLString = " SELECT [Personnel].p_id, [Personnel].first_name, [Personnel].surname, [Office].Office_name,[Personnel].[dept_id], [Personnel].[Office], [Personnel].extension_id, [Department].department, [Personnel].[division], [Divisions].divisions " & _
" FROM [Office],[Personnel],[Department], [Divisions] where [Office].Office_id = [Personnel].[Office] " & _
" and [Department].dept_id = [Personnel].[dept_id] " & _
" and [Divisions].div_id = [Personnel].[division] " & _
" and [Personnel].[office] = " & request.form("off_name")


However, it doesnt seem to be able to pull the value from the form element. Im getting a snytax error but i cant see anything wrong. Any ideas?

Thanx in advanceYou love those syntax errors, dontcha? :P

I dont see anything wrong with the request call.

Try just printing out the .form variable like this

response.write(request.form("off_name") )
response.end

right at the top of your page.

If that returns the value just fine to the screen, then it's no problem with retrieving values from your form (which usually doesn't result in a syntax error anywho)

From there, I'd start checking your Sql statement by making it very simple - remove the where clause entirely and then start adding it back piece by piece to see if it's part or all the where clause doing it or something else.
 
Back
Top