This topic is locked

WHERE for dropdown problem

12/9/2005 5:48:01 AM
ASPRunnerPro General questions
I
isaksson author

Hi,
I am trying to limit the displayfield based on another field, i.e. show NAME when DEPARTMENT = Session("OwnerID").
I am only getting errors whatever I put in the where clause.... Is this possible, or can I only do where clause on the field being displayed?
Regards.
Tariq

Sergey Kornilov admin 12/12/2005

Tariq,
what is the exact error message you getting?
If DEPARMENT is a text field do npot forget to add single quotes around Session("OwnerID")

DEPARTMENT = "'" & Session("OwnerID") & "'"
I
isaksson author 12/13/2005

The error I get is:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/risk/include/qryXRef_numRisk_aspfunctions.asp, line 851

Sergey Kornilov admin 12/15/2005

Tariq,
if DEPARTMENT is a text field, try this one:

"DEPARTMENT = '" & Session("OwnerID") & "'"



If not, then this:

"DEPARTMENT = " & Session("OwnerID")