View Full Version : Search query help

09-13-2005, 12:19 PM
I'm totally new to SQL so please bare with me, I have a multiple dropdown menu search on my site and I want to replace one of the dropdown with a query that will select a specific product group which the customer can then search using the other two menus. I have managed to select the product group but when I delete the code for the dropdown it doesn't work anymore. Any help would be greatly appreciated.

strQuery = "SELECT * FROM Comics WHERE ProductGroup='Marvel';"
Set objRS = objConn.Execute(strQuery)
dropdown(0) = "<SELECT SIZE=1 NAME=productset>"
dropdown(0) = dropdown(0) & "<OPTION></OPTION>"
While NOT objRS.EOF
dropdown(0) = dropdown(0) & "<OPTION>" & objRS("ProductGroup") & "</OPTION>"
dropdown(0) = dropdown(0) & "</SELECT>"

09-14-2005, 04:33 AM
Well if other form fields are relying on this field perhaps with JavaScript or something then you can still keep the field without it being visible:

<input type="hidden" name="productset" value="Marvel">


productset = "Marvel"

<input type="hidden" name="productset" value="<%= productset %>">

And don't know if this link is related at all:

Classic ASP Design Tips - Dependent Listboxes

09-14-2005, 03:03 PM
Thanks for the help, I'll try it out and let you how it goes.

09-14-2005, 03:27 PM
I used

<input type="hidden" name="productset" value="Marvel">
and it works perfectly, thank you for the help.

09-14-2005, 05:37 PM
You're welcome and glad it worked! :)