I am very, very new to ColdFusion and am trying to make my job alot easier. I have made gotten as far as making a search page which gives you the option to search by either ID number or First Name or Last Name. Upon submitting I get the 10 results on the first page. the problem is when i click on the "NEXT" button it gives me an error message which is displayed in the attachment. Thank you in advance for any and all assistance you give me with this issue.
CODE
<cfparam name="PageNum_Prisoner" default="1">
<cfset WhereClause = " 0=0">
<!--- Search by First Name --->
<cfif FORM.FirstName IS NOT "">
<cfset WhereClause = WhereClause & " AND FirstName LIKE '%" & FORM.FirstName & "%'">
</cfif>
<!--- Search by Last Name --->
<cfif FORM.LastName IS NOT "">
<cfset WhereClause = WhereClause & " AND LastName LIKE '%" & FORM.LastName & "%'">
</cfif>
<!--- Search by CB Number which is the ArrestID --->
<cfif FORM.ArrestID IS NOT "">
<cfset WhereClause = WhereClause & " AND ArrestID LIKE '%" & FORM.ArrestID & "%'">
</cfif>
<!--- Query --->
<cfquery name="Prisoner" datasource="Prisoner">
SELECT ArrestID, FirstName, MiddleName, LastName
FROM tblprisoner
</cfquery>
<cfset MaxRows_Prisoner=10>
<cfset StartRow_Prisoner=Min((PageNum_Prisoner-1)*MaxRows_Prisoner+1,Max(Prisoner.RecordCount,1))>
<cfset EndRow_Prisoner=Min(StartRow_Prisoner+MaxRows_Prisoner-1,Prisoner.RecordCount)>
<cfset TotalPages_Prisoner=Ceiling(Prisoner.RecordCount/MaxRows_Prisoner)>
<cfset QueryString_Prisoner=Iif(CGI.QUERY_STRING NEQ "",DE("&"&XMLFormat(CGI.QUERY_STRING)),DE(""))>
<cfset tempPos=ListContainsNoCase(QueryString_Prisoner,"PageNum_Prisoner=","&")>
<cfif tempPos NEQ 0>
<cfset QueryString_Prisoner=ListDeleteAt(QueryString_Prisoner,tempPos,"&")>
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Prisoner Results</title>
</head>
<body>
<table align="center" width="200" border="1" bordercolor="#0000FF">
<tr>
<th scope="col">CB#</th>
<th scope="col">First Name </th>
<th scope="col">Last Name </th>
</tr>
<cfoutput query="Prisoner" startRow="#StartRow_Prisoner#" maxRows="#MaxRows_Prisoner#">
<tr>
<td>#Prisoner.ArrestID#</td>
<td>#Prisoner.FirstName#</td>
<td>#Prisoner.LastName#</td>
</tr>
</cfoutput>
</table>
<br>
<table border="0" width="50%" align="center">
<cfoutput>
<tr>
<td width="23%" align="center"><cfif PageNum_Prisoner GT 1>
<a href="#CurrentPage#?PageNum_Prisoner=1#QueryString_Prisoner#">First</a>
</cfif>
</td>
<td width="31%" align="center"><cfif PageNum_Prisoner GT 1>
<a href="#CurrentPage#?PageNum_Prisoner=#Max(DecrementValue(PageNum_Prisoner),1)##QueryString_Prisoner#">Previous</a>
</cfif>
</td>
<td width="23%" align="center"><cfif PageNum_Prisoner LT TotalPages_Prisoner>
<a href="#CurrentPage#?PageNum_Prisoner=#Min(IncrementValue(PageNum_Prisoner),TotalPages_Prisoner)##QueryString_Prisoner#">Next</a>
</cfif>
</td>
<td width="23%" align="center"><cfif PageNum_Prisoner LT TotalPages_Prisoner>
<a href="#CurrentPage#?PageNum_Prisoner=#TotalPages_Prisoner##QueryString_Prisoner#">Last</a>
</cfif>
</td>
</tr>
</cfoutput>
</table>
<br>
</body>
</html>