8 Replies Latest reply on May 12, 2015 4:41 PM by philmodjunk

    How to know when last the record in a selection is reached?

    pauhana658

      Title

      How to know when last the record in a selection is reached?

      Post

      I have a selection of records that varies from session to session. The records are stepped trough in sequence. If I'm on the last record in the selection, when I click the "Next" button on the layout, I want to  go to another layout. I figure that the logic would be something like, 

      If [last record in selection]
           go to layout (Finished!)
      End if

      I suppose that I could use Get (foundcount) to determine the number of records in the selection, then increment a variable by 1 each time the next record is loaded, and then when the variable value equals Get (foundcount), go to the "Finished!" layout, but that seems rather convoluted. Surely there is a much simpler way to determine via scripting when I'm looking at the final record in a selection. Any ideas?

      Thanks!