This topic is locked

Query using hyperlink

2/13/2009 11:26:42 AM
ASPRunnerPro General questions
H
huffharper author

I have been using hyperlinks to filter records on pages such as :

href = "http://www.mysite.com/myView_list.asp?a=search&value=1&SearchFor=yes&SearchOption=Equals&SearchField=Active";
Unfortunately this populates my search input with 'Yes" when the pages load and doesn't seem as functional as I would like.
How would I run a query when hyperlink is clicked? I tried working with: strWhereClause = whereAdd(strWhereClause, "Active = Yes") couldn't get there.
Thanks in advance for any help.
Huff

J
Jane 2/16/2009

Huff,
your link looks correct.

It should filter records on the list page and show all active records only.

Please give me more detailed description of what doesn't work properly.

H
huffharper author 2/16/2009

My links are working properly. I have a page that loads in my dashboard and opens with a set of records based on the session user. I would like to 'click' a link or button and work within a different set of records from the same table, records for all users. If I use a page link I lose the ability to search within the current recordset.
The answer may be to create multiple views and work within those but I end up with a lot of views for the same table.. I am trying to set the filter on a recordset based on a button or link and then work within those records in the current session.
Thanks for any help..

Huff

J
Jane 2/17/2009

Huff,
I see what you're saying.

Try to use this link:

href = "http://www.mysite.com/myView_list.asp?For=yes&Option=Equals&Field=Active
The add where clause in the List page: Before SQL query event:

if request.querystring("Field")<>"" and request.querystring("For")<>"" then

strWhereClause = whereAdd(strWhereClause, request.querystring("Field") & " = " & request.querystring("For"))

end if