Reversing a sort option

Reversing a sort option

Post by Sue » Wed, 28 Aug 2002 23:06:35



I have an Access 2000 database set up in FP2002 and on my
search page in the DRW I offer the option to sort by field
which works fine. I have been asked if it is possible to
reverse the sort with a second click. This is the code I
have for the sort option which sorts asc. Is it possible
to do a second click and make it go in desc order? In my
select statement with the wizard I have ORDER BY ::order::
Can anyone help?

<form method="POST">
<p>
<input type="image" src="images/sort.gif" name="I1">
<input type="hidden" name="Make" value="<%=Request("Make")%

Quote:>">

<input type="hidden" name="Model" value="<%=Request
("Model")%>">
<input type="hidden" name="Year" value="<%=Request("Year")%
Quote:>">

<input type="hidden" name="order" value="Year">
<br>
Year</p>
      </form>

Thanks,
Sue

 
 
 

Reversing a sort option

Post by Stephen Travi » Thu, 29 Aug 2002 06:40:37


Try this;

<input type="hidden" name="order" value="<%If Request("order") = "Year" Then Response.Write("Year DSC") Else Response.Write "Year"
End If%>">

--

Stephen Travis
Microsoft MVP - FrontPage


> I have an Access 2000 database set up in FP2002 and on my
> search page in the DRW I offer the option to sort by field
> which works fine. I have been asked if it is possible to
> reverse the sort with a second click. This is the code I
> have for the sort option which sorts asc. Is it possible
> to do a second click and make it go in desc order? In my
> select statement with the wizard I have ORDER BY ::order::
> Can anyone help?

> <form method="POST">
> <p>
> <input type="image" src="images/sort.gif" name="I1">
> <input type="hidden" name="Make" value="<%=Request("Make")%
> >">
> <input type="hidden" name="Model" value="<%=Request
> ("Model")%>">
> <input type="hidden" name="Year" value="<%=Request("Year")%
> >">
> <input type="hidden" name="order" value="Year">
> <br>
> Year</p>
>       </form>

> Thanks,
> Sue


 
 
 

Reversing a sort option

Post by Stephen Travi » Thu, 29 Aug 2002 06:40:37


--

Stephen Travis
Microsoft MVP - FrontPage


> I have an Access 2000 database set up in FP2002 and on my
> search page in the DRW I offer the option to sort by field
> which works fine. I have been asked if it is possible to
> reverse the sort with a second click. This is the code I
> have for the sort option which sorts asc. Is it possible
> to do a second click and make it go in desc order? In my
> select statement with the wizard I have ORDER BY ::order::
> Can anyone help?

> <form method="POST">
> <p>
> <input type="image" src="images/sort.gif" name="I1">
> <input type="hidden" name="Make" value="<%=Request("Make")%
> >">
> <input type="hidden" name="Model" value="<%=Request
> ("Model")%>">
> <input type="hidden" name="Year" value="<%=Request("Year")%
> >">
> <input type="hidden" name="order" value="Year">
> <br>
> Year</p>
>       </form>

> Thanks,
> Sue

 
 
 

Reversing a sort option

Post by Stephen Travi » Thu, 29 Aug 2002 06:49:59


That's DESC

--

Stephen Travis
Microsoft MVP - FrontPage


> Try this;

> <input type="hidden" name="order" value="<%If Request("order") = "Year" Then Response.Write("Year DSC") Else Response.Write "Year"
> End If%>">

> --

> Stephen Travis
> Microsoft MVP - FrontPage


> > I have an Access 2000 database set up in FP2002 and on my
> > search page in the DRW I offer the option to sort by field
> > which works fine. I have been asked if it is possible to
> > reverse the sort with a second click. This is the code I
> > have for the sort option which sorts asc. Is it possible
> > to do a second click and make it go in desc order? In my
> > select statement with the wizard I have ORDER BY ::order::
> > Can anyone help?

> > <form method="POST">
> > <p>
> > <input type="image" src="images/sort.gif" name="I1">
> > <input type="hidden" name="Make" value="<%=Request("Make")%
> > >">
> > <input type="hidden" name="Model" value="<%=Request
> > ("Model")%>">
> > <input type="hidden" name="Year" value="<%=Request("Year")%
> > >">
> > <input type="hidden" name="order" value="Year">
> > <br>
> > Year</p>
> >       </form>

> > Thanks,
> > Sue