title: Select from the drop-down populating 2nd category
body: <p>I have one table called <code>tbl_Teacher</code> with data as:</p>
  
  <pre class="lang-none prettyprint-override"><code>Teacher_ID   Lastname   Firstname   Department
  1               aaa         Joe         Math
  2               bbb         Jenny       History
  3               ccc         Mark        Math
  </code></pre>
  
  <p>I created an ASP <code>SELECT</code>.  If I select "aaa, Mark" from drop-down list, then "Match" will be automatically selected on the second drop-down list.  However, it does not take any value after I select the Last and Firstname; it shows No department found.</p>
  
  <p>What did I do wrong? can anyone help?</p>
  
  <p>Thanks very much.</p>
  
  <p>Here is the code:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>&lt;%  Set rsSelect = Server.CreateObject("adodb.recordset")
      strSQL = "SELECT Lastname, Firstname, Teacher_ID FROM tbl_Teacher;"
      rsSelect.Open strSQL, strCon
      Dim strID
      strID = Request.QueryString("Teacher_ID")
      if not rsSelect.eof then %&gt;
          &lt;select name="Name" onChange="this.form.action='Teacher.asp';this.form.submit();"&gt;
               &lt;option value="1"&gt;Select a Teacher&lt;/option&gt;
               &lt;% do until rsSelect.eof %&gt;
                  &lt;option value="&lt;%= rsSelect(0) %&gt;" &lt;% if trim(request.Form("Name")) = trim(rsSelect(0)) then response.write " selected "end if %&gt;&gt;&lt;%= rsSelect("Lastname") %&gt;, &lt;%= rsSelect("Firstname") %&gt;&lt;/option&gt;
                  &lt;%  rsSelect.MoveNext
               loop       %&gt;
           &lt;/select&gt;
           &lt;% end if 
  
      if trim(request.Form("Name")) &lt;&gt; "" then
          strSQL = "SELECT Department FROM tbl_Teacher WHERE Teacher_ID = '" &amp; Request.Form("strID") &amp; "';"
          Set rsSelect = Server.CreateObject("adodb.RecordSet")
          rsSelect.Open strSQL, strCon
          if not rsSelect.eof then %&gt;
              &lt;select name="Department"&gt;
                  &lt;% do until rsSelect.eof       %&gt;
                      &lt;option value="&lt;%= rsSelect("Department") %&gt;"&gt;&lt;%= rsSelect("Department") %&gt;&lt;/option&gt;
                      &lt;% rsSelect.MoveNext
                  loop %&gt;
              &lt;/select&gt;
              &lt;% else %&gt;
                  &lt;i&gt;No Department found&lt;/i&gt;
              &lt;%  end if
          else
              response.write "&lt;i&gt;Select a Department&lt;/i&gt;"
          end if %&gt;
  </code></pre>