Hello Kevin,
First here is the offending line....
tlength = rs("TrailerLength")
TrailerLength is a Text field in an Access Table. I checked the data,
especially the area after the last line printed on the search results and
could find no problem.
Here is the entire Method:
<%
SortBy = Request.Form("SortBy")
SortMess = ""
If SortBy = "DateLoading" then
SortOrder = "DateLoading, OriginState, OriginCity, DestinationState,
DestinationCity "
SortMess = "Sorted by Load Date/ Origin State/ Destination State"
ElseIf SortBy = "OriginState" then
SortOrder = "OriginState, OriginCity, DestinationState, DestinationCity,
DateLoading"
SortMess = "Sorted by Origin State/ Destination State/ Load Date"
ElseIf SortBy = "DestinationState" then
SortOrder = "DestinationState, DestinationCity, OriginState, OriginCity,
DateLoading"
SortMess = "Sorted by Destination State/ Origin State/ Load Date"
End If
Set rs = Server.CreateObject("ADODB.RecordSet")
q = "SELECT LoadID, OriginCity, OriginState, DestinationCity, " &_
"DestinationState, DateLoading, TrailerLength, TrailerType, comments,
Recurring FROM Loads WHERE (Recurring = False) AND (1=1)"
dateavail = Request.Form("dateavail")
if dateavail <> "" then
if NOT IsDate(dateavail) then
Session("mess") = "The date you entered for the Date Loading is not
formatted properly. Please enter it again."
Response.Redirect "searchloads.asp"
else
q = q & " AND (DateLoading = #" & dateavail & "#)"
end if
else
q = q & " AND (DateLoading >= #" & date() & "#)"
end if
originstate = Request.Form("originstate")
if originstate <> "" then
q = q & " AND (OriginState LIKE '%" & originstate & "%')"
end if
destinationstate = Request.Form("destinationstate")
if destinationstate <> "" then
q = q & " AND (DestinationState LIKE '%" & destinationstate & "%')"
end if
trailertype = Request.Form("trailertype")
q = q & " AND (TrailerType LIKE '%" & trailertype & "%')"
q = q & " Order by " & SortOrder
rs.Open q, "DSN=TruckLoadsDev;"
%>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<title>Search Loads - Matching Records</title>
<meta name="Microsoft Border" content="tb">
</head>
<body bgcolor="#FFFFFF" link="#000080" vlink="#800080" alink="#000080"
background="../images/trucksbg3.jpg">
<table width="800" cellpadding="2" align="LEFT" valign="TOP">
<tr>
<!-- Button Column -->
<td width="125" align="LEFT" valign="TOP"> </td>
<!-- Content column -->
<td align="LEFT" valign="TOP"><table border="0" width="100%">
<tr>
<td width="100%" align="left"><font size="4"><strong>Search Loads -
Matching Records</strong></font></td>
</tr>
</table>
<p><%if NOT rs.EOF then%><b><font size="2" color="#800000">Records
matching the parameters you specified are listed below. To see the details
or
contact the Company which owns the load, click on the Origin for
that load.</font></b></p>
<p><a href="../asp/searchloads.asp"><strong>Search
Again</strong></a></p>
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%"><b><% Response.Write SortMess %></b></td>
</tr>
</table>
</div>
<table border="0" width="800">
<tr>
<td width="155" valign="top" align="left"
bgcolor="#9999FF"><strong><font size="2">Origin
State, City</font></strong></td>
<td width="165" valign="top" align="left"
bgcolor="#9999FF"><strong><font size="2">
Destination State, City</font></strong></td>
<td width="128" valign="top" align="left"
bgcolor="#9999FF"><strong><font size="2">Trailer Type</font></strong></td>
<td width="78" valign="top" align="left"
bgcolor="#9999FF"><strong><font size="2">Date
Loading</font></strong></td>
<td width="242" valign="top" align="left"
bgcolor="#9999FF"><strong><font size="2">Comment</font></strong></td>
</tr>
<%while NOT rs.EOF
Datel = ""
Recur = ""
if rs("Recurring") = False then
DateL = rs("DateLoading")
else
Recur = "Recurring"
End If
if rs("TrailerLength") = 0 then
tLength = ""
else
tlength = rs("TrailerLength")
End If
%>
<tr>
<td width="155" valign="top" align="left" bgcolor="#FFFFFF"><a
target="_blank" href="loaddetails.asp?loadid=<%=rs("LoadID")%>"><font
size="2"><%Response.Write rs("OriginState") & ", " &
rs("OriginCity")%></font></a>
</td>
<td width="165" valign="top" align="left" bgcolor="#FFFFFF"><font
size="2"><%=rs("DestinationState") & ", " & rs("DestinationCity")%></font>
</td>
<td width="128" valign="top" align="left" bgcolor="#FFFFFF"><font
size="2"><%=tlength & " " & rs("TrailerType")%></font>
</td>
<td width="78" valign="top" align="left" bgcolor="#FFFFFF"><font
size="2"><%=DateL%></font>
</td>
<td width="242" valign="top" align="left" bgcolor="#FFFFFF"><font
size="2"><%=rs("Comments")%>
</font> </td>
</tr>
<tr>
<%
rs.MoveNext
wend%>
</tr>
</table>
<p><strong><a href="../asp/searchloads.asp">Search Again</a>
<br>
</strong></p>
<p><%else%></p>
<p><strong><font size="4"><font color="#FF0000">No Loads matched your
query.</font>
<a href="../asp/searchloads.asp">Try again</a></font></strong></p>
<p><%end if%>
<p> </td>
</tr>
<tr>
<td width="150" align="LEFT" valign="TOP"></td>
<td align="LEFT" valign="TOP"><b><span lang="en-us"><font face="Arial">
<font color="#FF0000">We would like you to take a survey for a new
service
to help you get more business.</font><br>
<a target="_blank"
href="
http://www.Plan-It-Earth.Net/TLOSurvey/Default.htm">
Click Here</a></font></span></b></td>
</tr>
</table>
<p> <img
src="
http://www.stattrax.com/cgi/stattrax.cgi?account=3333&page=513"
width="1" height="1"> </body>
</html>