Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Query Help With IIF Statement

Status
Not open for further replies.

smurfer

Programmer
Jun 8, 2001
57
US
I am trying to write a query containing an IIF statement as criteria for one of the columsn in the query. I am using db users and validating against their userId using the CurrentUser() function. What I am trying to do is allow a manager to see queries including his employees work, but to restrict them to only seeing their own.

I have a users table which has a column userid equivalent to the values possible in Assigned to.
I want to allow the different users to see only their assigned to Incidents, unless they are a manager, whom would be able to see theirs and any other employee for which they manage.

Setting this in the criteria box of the assigned to column:
My IIF statement looks like this,

IIF(CurrentUser() in ("Admin", "JSmoe"), (Select UserId from Users where managerId = CurrentUser(), CUrrentUser())

Basically I want to have the true part of the if statement have values in an "IN" list if possible.

Any help how to do this would be helpful..

Thanks,
SM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top