move the } of the if AFTER the while, because your script try the while also if $search is false, in this case it return error because $result is not defined...
also check if there is errors in the query
the new code sounds like this:
if ($search) // perform search only if a string was entered.
{
mysql_connect("localhost","****","****") or die ("Problem connecting to Database");
$query = "select * from contacts WHERE subsno LIKE '$subsno'";
$result = mysql_db_query("moneyfacts", $query);
// check if there are errors in the query
if ( mysql_errno() )
die("Error executing query $query\n".mysql_errno().": ".mysql_error());
while ($r = mysql_fetch_array($result)) { // Begin while
$contactname = $r["contactname"];
$contactphone = $r["contactphone"];
$contactemail = $r["contactemail"];
$subsno = $r["subsno"];
// $resolved = $r["resolved"];
echo "<tr>
<td>$contactname</td>
<td>$contactphone</td>
<td>$contactemail</td>
<td>$subsno</td>
<tr>
</tr>";
} // end while
echo "</table>";
}