Skip to main content
Inspiring
January 6, 2009
Question

Looping through results with "Next" button

  • January 6, 2009
  • 2 replies
  • 309 views
I have coding that loops through the results of a query with "Next" and "Previous" links. It takes you to the next result but keeps you on the same page. Is there a way to do almost the same thing but with only a "Next" link? Then when you reach the last result clicking "Next" again will jump back to the first result? So if you had 3 results you would continuously hit next and just loop them over and over. Attached is the coding I am using now.
    This topic has been closed for replies.

    2 replies

    brianismAuthor
    Inspiring
    January 9, 2009
    Thanks! I knew it had to be easy, my brain is just fried from this project.
    Participating Frequently
    January 9, 2009
    Looks like you'd just need to add one final IF statment that checks to see if you've browsed to the last subset of records. Since you're browsing in sets of 10 you'd need to do a check to see if your startrow plus 10 is GTE the recordcount; if so that means you're viewing the 'last' set of records in the group, and need to adjust the "View Next" link so that it starts over at the first row now.