sql="select * from OFFICE"
RS2.Open sql,conn,adOpenStatic,adLockReadOnly
Do Until RS2.Eof
Response.write "<option value=""" & RS2(0)& """"
if ""&RS2(0)=Request("OFFICE") then response.write " selected"
Response.write ">" & RS2(1)
RS2.Movenext
Loop
RS2.Close
%>
</select>
อันที่2
<select name="WG" onchange="action='';submit();">
<option value="">·Ñé§ËÁ´ </option>
<%
if Request("OFFICE")<>"" then
sql="select * from WorkGroup where type=" &Request("OFFICE") & " order by 1"
RS2.Open sql,conn,adOpenStatic,adLockReadOnly
Do Until RS2.Eof
Response.write "<option value=" & RS2("ID_WG")
if ""&RS2("ID_WG")=Request("WG") then response.write " selected"
Response.write ">" & RS2("WG")
RS2.Movenext
Loop
RS2.Close
end if
sql = "select * from profile,Duty where profile.Duty_P=Duty.ID_Duty "
if Request("OFFICE") <>"" then sql = sql &"and OFFICE_P = '" & Request("OFFICE") & "'"
if Request("WG")<>"" then sql = sql &" and WG_P = '" & Request("WG") & "' "
sql = sql &" order by Number asc"
RS.Open sql,conn,adOpenStatic,adLockReadOnly
Do Until RS.Eof
Response.write "<option value=""" & RS("userid")& """"
if ""&RS("userid")=Request("select1") then response.write " selected"
Response.write ">" & RS("Name_P") &" (" & RS("Duty") &")"
RS.Movenext
Loop
RS.Close
%>
</select>