Display Record Count
How do I display the record count on my search results pages, e.g. Records 1-25 of 56?
Replace the variable "myrecordsetname" with the name of the recordset you want to display the count for. If you have more than one repeat region, you may need to adjust the Repeat1__numRows variable to match the name of the repeat region you want to count. If you have only one repeat region, it will be named Repeat1__numRows by default.
Just above the opening <html> tag put the following code.
<%
If Request.QueryString("offset") <> "" Then
RecordNum =Cint(Request.QueryString ("offset"))
If myrecordsetname_total > Cint(Request.QueryString("offset") )+ Repeat1__numRows then
RecordNum2 = Cint(Request.QueryString ("offset"))+ Repeat1__numRows
Else
RecordNum2 = Cint(Request.QueryString ("offset")) + (myrecordsetname_total - Cint(Request.QueryString ("offset")))
End if
Else
RecordNum = 1
if myrecordsetname_total > Repeat1__numRows then
RecordNum2 = Repeat1__numRows
Else
RecordNum2 = myrecordsetname_total
End if
End if
%>
Replace the variable "myrecordsetname" with the name of the recordset you want to display the count for. If you have more than one repeat region, you may need to adjust the Repeat1__numRows variable to match the name of the repeat region you want to count. If you have only one repeat region, it will be named Repeat1__numRows by default.
Where you want to display the count, put the following line of code:
<%= "Records " & RecordNum & "-" & RecordNum2 & " of " & myrecordsetname_total%>
Comments
Be the first to write a comment
You must me logged in to write a comment.