Hi, I got a script from a site to page results from a db. That all went fine. But I wanted to let the user decide how many per page are viewed.
Initially, the number of results per page was set by
const PAGE_SIZE = 5
so, I changed that to
Dim Page_size
Dim pagesz
Set pagesz = 5
Then, in the 'next page' link, referenced that so it would pass it over to the next page.
Then I put in a small form named Resultspp, and directed back at itself.
I added
Dim Resultspp
Set Resultspp = Request.Form("Resultspp")
Then used this...
'Check if anything was submitted on the form
IF Resultspp = " " THEN
'If it's empty, see if anything was submitted via the 'next page' link
If Request.QueryString("Resultspp") = " " THEN
'If That's empty too, set Page_Size to pagesz, which is 5
Set Page_Size = "'pagesz'"
'If, however, there was data in the querystring, use that
Else
Set Page_Size = Request.QueryString("Resultspp")
End If
'But, if there was data sent in the form -- use that
Else
Set Page_Size = Resultspp
End If
Any help of this would be gratefully recieved!
regards
David Aldred