Les,
Thanks for your reply, this was very helpfull
But I have one more question...
There is no way that we can do it within the same page, instead of making 2 more HTML pages for NexRec and PrevRec?
BR
>Hi Ahmad,
>
> When you build the page's HTML code, for the Next and Previous buttons generate anchors that contain the current record's key and point to NextRec.asp and PrevRec.asp, respectively:
>
>
Next record>
Previous record>
>Then, in the two ASPs, find the correct record and build the same page layout. The only difference between NextRec.asp and PrevRec.asp will be the SQL code.
>
>In NextRec.asp, use
>
> CurrRecKey = Request("CurrRecKey")
> Cmd = "SELECT TOP 1 * FROM RecTable WHERE ID >" & CurrRecKey & " ORDER BY ID"
>
>In PrevRec.asp use ORDER BY ID DESC"
>
> CurrRecKey = Request("CurrRecKey")
> Cmd = "SELECT TOP 1 * FROM RecTable WHERE ID <" & CurrRecKey & " ORDER BY ID DESC"
>
>
>This assumes you're using SQL 7.0 or Oracle. Be careful about the use of "<" and ">".
>
>Les
<><><><><><><><><><><><><><><><><><><><>
<><> REMEMBER,,,,KNOWLEDGE IS POWER <><>
<><><><><><><><><><><><><><><><><><><><>