I am trying to make a dynamic search page. I am using a access database. The problem is that in order to get records returned, it requires me to enter both a name and a ProblemType. If you just enter in just a name, it does not find any records, however if you just input a ProblemType it works...go figure. Any pointers to where the problem is, Thanks alot
*This is the code for the the submit query*
<CFQUERY
DATASOURCE="employee_info"
NAME="Departments">
SELECT Department_ID
FROM Department
ORDER BY Department_ID
</CFQUERY>
<html>
<head>
<title>Problem Search</title>
</head>
<body>
<h2>Please enter your search text below</h2>
<FORM ACTION="SearchResults.cfm" METHOD="POST">
Name: <INPUT TYPE="text" NAME="Name"><BR>
Department:
<SELECT NAME="Department">
<OPTION>
<CFOUTPUT QUERY="Departments">
<OPTION VALUE="#Department_ID#">#Department_ID#
</cfoutput>
</select><BR>
Problem Type:
<SELECT name="ProblemType">
<OPTION value="0">
<OPTION value="Applied">Applied
<OPTION value="Account Locked-out">Account Locked-out
</SELECT><BR>
Problem Description: <INPUT TYPE="text" NAME="ProblemDescription"><BR>
Resolved By: <INPUT TYPE="text" NAME="ResolveBy"><BR>
<P>
<INPUT TYPE="submit" VALUE="Search">
<INPUT TYPE="reset" VALUE="Clear">
</form>
</body>
</html>
*This is the search result*
<CFQUERY
DATASOURCE="help_desk"
NAME="HelpSearch">
SELECT *
FROM Help
WHERE 0 = 0
<CFIF Name IS NOT "">
AND First_Name LIKE '#Name#%'
</CFIF>
<CFIF ProblemType IS NOT "">
AND Problem_Type = '#ProblemType#'
</CFIF>
</CFQUERY>
<html>
<head>
<title>Problem List</title>
</head>
<body>
<H3>Found #HelpSearch.RecordCount# Results</h3>
<cfloop query="HelpSearch">
<cfoutput>
<table align="left">
<tr>
<td align="left" width="175"><b>Name:</b></td>
<td align="left">#First_Name#</td>
<tr>
<td align="left" width="175"><b>Problem Type:</b></td>
<td align="left">#ProblemType#</td>
</tr>
</table>
</cfoutput>
</cfloop>
</body>
</html>
*This is the code for the the submit query*
<CFQUERY
DATASOURCE="employee_info"
NAME="Departments">
SELECT Department_ID
FROM Department
ORDER BY Department_ID
</CFQUERY>
<html>
<head>
<title>Problem Search</title>
</head>
<body>
<h2>Please enter your search text below</h2>
<FORM ACTION="SearchResults.cfm" METHOD="POST">
Name: <INPUT TYPE="text" NAME="Name"><BR>
Department:
<SELECT NAME="Department">
<OPTION>
<CFOUTPUT QUERY="Departments">
<OPTION VALUE="#Department_ID#">#Department_ID#
</cfoutput>
</select><BR>
Problem Type:
<SELECT name="ProblemType">
<OPTION value="0">
<OPTION value="Applied">Applied
<OPTION value="Account Locked-out">Account Locked-out
</SELECT><BR>
Problem Description: <INPUT TYPE="text" NAME="ProblemDescription"><BR>
Resolved By: <INPUT TYPE="text" NAME="ResolveBy"><BR>
<P>
<INPUT TYPE="submit" VALUE="Search">
<INPUT TYPE="reset" VALUE="Clear">
</form>
</body>
</html>
*This is the search result*
<CFQUERY
DATASOURCE="help_desk"
NAME="HelpSearch">
SELECT *
FROM Help
WHERE 0 = 0
<CFIF Name IS NOT "">
AND First_Name LIKE '#Name#%'
</CFIF>
<CFIF ProblemType IS NOT "">
AND Problem_Type = '#ProblemType#'
</CFIF>
</CFQUERY>
<html>
<head>
<title>Problem List</title>
</head>
<body>
<H3>Found #HelpSearch.RecordCount# Results</h3>
<cfloop query="HelpSearch">
<cfoutput>
<table align="left">
<tr>
<td align="left" width="175"><b>Name:</b></td>
<td align="left">#First_Name#</td>
<tr>
<td align="left" width="175"><b>Problem Type:</b></td>
<td align="left">#ProblemType#</td>
</tr>
</table>
</cfoutput>
</cfloop>
</body>
</html>