% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Results_total Dim Results_first Dim Results_last ' set the record count Results_total = Results.RecordCount ' set the number of rows displayed on this page If (Results_numRows < 0) Then Results_numRows = Results_total Elseif (Results_numRows = 0) Then Results_numRows = 1 End If ' set the first and last displayed record Results_first = 1 Results_last = Results_first + Results_numRows - 1 ' if we have the correct record count, check the other stats If (Results_total <> -1) Then If (Results_first > Results_total) Then Results_first = Results_total End If If (Results_last > Results_total) Then Results_last = Results_total End If If (Results_numRows > Results_total) Then Results_numRows = Results_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Results_total = -1) Then ' count the total records by iterating through the recordset Results_total=0 While (Not Results.EOF) Results_total = Results_total + 1 Results.MoveNext Wend ' reset the cursor to the beginning If (Results.CursorType > 0) Then Results.MoveFirst Else Results.Requery End If ' set the number of rows displayed on this page If (Results_numRows < 0 Or Results_numRows > Results_total) Then Results_numRows = Results_total End If ' set the first and last displayed record Results_first = 1 Results_last = Results_first + Results_numRows - 1 If (Results_first > Results_total) Then Results_first = Results_total End If If (Results_last > Results_total) Then Results_last = Results_total End If End If %>