This topic is locked

Quick Search - Only Search Advanced Search Results

9/15/2009 8:04:06 PM
ASPRunnerPro General questions
B
bpawlowski author

Hello
Here's my issue. I have a user who uses the "Advanced Search", and then wants to use the "Quick Searck" to refine the results. When they go to the "Quick Search", and enter anything in, they are presented with results for the entire DB..not just the records that have been defined in the previous search.
Is there a way to force the "Quick Search" search button to only search through the records that are on the screen? I've reset both the "Advanced Search" page, and the "List" page (that the quick search is on...and I still have the same issue).
Any help would be greatly appreciated. I need to have them do 2 searches, 1 after the other, because they want to search for an any "Any" condition in "Advanced Search", followed by an "All" condition in the "Quick Search".
Thanks;
Ben

J
Jane 9/16/2009

Hi,
you can check where clause in the List page: Before SQL query event on the Events tab and add advanced search parameters manually.

Here is a sample:

if request.querystring("a")="advsearch" then

Session("advwhere") = strWhereClause

end if
if request.querystring("a")="search" and Session("advwhere")<>"" then

strWhereClause = whereAdd(strWhereClause,Session("advwhere"))

end if


We'll add this option to the next version.

C
clig 9/16/2009



Hi,
you can check where clause in the List page: Before SQL query event on the Events tab and add advanced search parameters manually.

Here is a sample:

if request.querystring("a")="advsearch" then

Session("advwhere") = strWhereClause

end if
if request.querystring("a")="search" and Session("advwhere")<>"" then

strWhereClause = whereAdd(strWhereClause,Session("advwhere"))

end if


We'll add this option to the next version.


That would be a cool feature

B
bpawlowski author 9/16/2009

OK...I need a little more help.
I have checkbox fields, so in my advanced search a user checks a field called "10s" and a field called "20s"....using the "Any condition".
What would I change in the code to reflect this? Is there a way to have it do a refined search, no matter what was searched for originally?
If not, I'd appreciate some help, as I have over 25 fields in the advanced search. I'll have to do some crazy "or" statements.
I appreciate the help.
Ben

J
Jane 9/17/2009

Ben,
have you applied code I'd mentioned before?

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detailed description of what you want to do.

B
bpawlowski author 9/17/2009



Ben,
have you applied code I'd mentioned before?

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detailed description of what you want to do.


I did. I did an advanced search, using "Any" (140 results) then tried to use the "Quick" search to filter down. My "Quick" search" still returned all of the results, not a filtered list (459 results), when it should have returned far less than 140.
I'll open a ticket tonight.
Thank you for your help.
Ben

B
bpawlowski author 9/24/2009

Hello
I applied the code, and it doesn't work. Does anyone have any other ideas? I thought it was a fairly simple request, but I guess not.
Let me know;
Ben

J
Jane 9/25/2009

Ben,
I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detailed description of what you want to do.

B
bpawlowski author 9/28/2009



Ben,
I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detailed description of what you want to do.



I did that. The Admin member who responeded sent me the same code to put in...code that doesn't work. I'll do it again....but the first attempt yielded nothing.
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=44344&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Ben

B
bpawlowski author 10/5/2009



I did that. The Admin member who responeded sent me the same code to put in...code that doesn't work. I'll do it again....but the first attempt yielded nothing.
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=44453&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Ben


Thank you very much for the help. Here is the code that works - 3 levels.
to create three-level search use following code in the "List page: Before SQL query" event:
-----------------------------

if request("a")="advsearch" then

Session("advwhere") = strWhereClause

end if
if request("a")="search" then

if Session("smpwhere")="" then

Session("smpwhere") = strWhereClause

else

Session("smpwhere") = whereAdd(strWhereClause,Session("smpwhere"))

end if
end if
if request("a")="search" and Session("advwhere")<>"" then

strWhereClause = whereAdd(strWhereClause,Session("advwhere"))

end if
if request("a")="search" and Session("smpwhere")<>"" then

strWhereClause = whereAdd(strWhereClause,Session("smpwhere"))

end if
if request("a")="showall" then

Session("smpwhere") = ""

Session("advwhere") = ""

end if