Assuming that the code is not on the page that the form is on, but rather on another page that the form submits to, you can try this. Let me know if it's what you're looking for.
<%
ListBox = request("ListBox")
set rs = server.createobject("adodb.recordset")
sql = "select * from table"
sql = sql & " where field1 = '" & Value1 & "'"
if ListBox = "" then
sql = sql & " and field2 = '" & Value2 & "'"
end if
rs.open sql, db, 3, 3
%>
|