This topic is locked

Lookup Wizard for search/advanced search

5/9/2004 5:00:43 PM
ASPRunnerPro General questions
Pete M author

Hi Sergey,
I was wondering if lookup wizards could be used to make dropowns for the 'advanced search page' against some/all fields?
Also, sometimes it would be useful to have a dropdown for the 'simple' search where only one field is to be searched.
I'm hoping these will be easier to achieve than dynamically filtered lookups <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=570&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />
Thanks
Pete

Sergey Kornilov admin 5/9/2004

Pete,
it's pretty easy to achieve. Intead of:

<input type=text size=20 name=SearchFor>


you can use the following. Just make sure dbConnection object is created and open at this moment:

<%

Set rsTemp = server.CreateObject ("ADODB.Recordset")

rsTemp.open strSQL, dbConnection

if not rsTemp.EOF then
  Response.Write "<select size =1 nameSearchFor>"

  Response.Write "<option value="""">Please select</option>"
  while not rsTemp.Eof

      Response.Write "<option value=""" & rsTemp(0) & """>" & rsTemp(1) & "</option>"

      rsTemp.MoveNext

  wend
end if

%>


I hope this helps.