Put the error in an if statement to check if the recordset is empty and the coupon form element was posted:
<?php if (($totalRows_RSName == 0) && (isset($_POST["txtCoupon"])) && ($_POST["txtCoupon"] != "")) { ?>
the cupon is not in the database
<?php } ?>