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
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"
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