      <?
      echo "<option value='' selected>--Select Sub Category--</option>";
      $mytradequery="Select * from settings_trades where tradelevel=3 order by tradecode, tradedescription"; 
      $mytraderesult =& $db_pms->query($mytradequery);
      $mytradecount=$mytraderesult->numRows();
      if ($mytradecount!=0) {
        while($mytraderow=$mytraderesult->fetchRow()) {
          foreach ($objsubtrades as $objsubtrade) {
            if ($mytraderow['tradepkey']==$objsubtrade['item_subtradepkey']) {
              echo "<option value='".$mytraderow['tradepkey']."' ";
              if ($mytraderow['tradepkey']==$objtradepkey3) { echo "selected"; }
              echo ">";
              echo $mytraderow['tradecode']." - ".$mytraderow['tradedescription'];
              echo "</option>";
            }
          }
        }
      }
      ?>
