Hello,

I am trying to capture what student logged in the system to filter appropriate Department.

Code:
<%
....
If Request.QueryString("Department")="" OR LEN(Request.QueryString("Department"))<1 Then
  strDepartmentSQL="tbl_students.Department LIKE '" & strGetUser_Department & "'"
  strDepartmentSelect="" & strGetUser_Department & ""
  strDepartment="" & strGetUser_Department & ""
ElseIf Request.QueryString("Department")="jenny" OR Request.QueryString("Department")="jimmy" OR Request.QueryString("Department")="will" Then
'ElseIf Request.QueryString("Department")="tbl_Students.Department IN (select Department from SelectDepartment)" Then
strDepartmentSQL="tbl_Students.Department LIKE '" & Request.QueryString("Department") & "'"
strDepartmentSelect="" & Request.QueryString("Department") & ""
ElseIf Request.QueryString("Department")="AllDepartments" Then
="tbl_Students.Department IN (select Department from SelectDepartment)"
strDepartmentSelect="All Departments"
 Else
   strDepartmentSQL="tbl_Students.Department LIKE 'Other'"
    strDepartmentSelect="All-Other-Departments"
End If
%>
"SelectDepartment" is an sql query that lists:
Dept
---
jenny
jimmy
will

It works just fine. However, I don't want to list the values of Dept on the asp script so I tried to do dynamically. I was successful with All Departments:
strDepartmentSQL="tbl_Students.Department IN (select Department from SelectDepartment)

However, I was failed when I tried to capture any student who is eitehr jimmy, jenny, or will as:
ElseIf Request.QueryString("Department")="tbl_Students.Department IN (select Department from SelectDepartment)" Then

How do I change it to make it works dynamically, without listing values on asp scripts like jimmy, jenny, or will like:
1. ElseIf Request.QueryString("Department")="jenny" OR Request.QueryString("Department")="jimmy" OR Request.QueryString("Department")="will" Then
==>
2. 'ElseIf Request.QueryString("Department")="tbl_Students.Department IN (select Department from SelectDepartment)" Then

If any student who loggs on the system with either jimmy, jenny, or will, will return somethings. In my case, it returns NONE.

Thanks for your help.