Try something like this: <td><div align="right"> <SELECT name="menu"> <?php $conn = odbc_connect("HOMES", "", ""); $billdate = $_POST[ 'billdate' ]; $q_menu = "SELECT DISTINCT sls_his_cust_id FROM sls_his where sls_his_prchdat_alt = $billdate"; $r_menu = odbc_exec($conn, $q_menu); while ($rec_menu = @odbc_fetch_array($r_menu)) $menu[] = $rec_menu; echo "<OPTION value=\"\">--SELECT--</OPTION>\n"; foreach ($menu as $m) { if ($m['sls_his_cust_id'] == $_POST['menu']) echo "<OPTION value=\"{$m['sls_his_cust_id']}\" SELECTED>{$m['sls_his_cust_id']}</OPTION>\n"; else echo "<OPTION value=\"{$m['sls_his_cust_id']}\">{$m['sls_his_cust_id']}</OPTION>\n"; } ?> </SELECT> </td>