Hello,
I've a query with only two fields from a table i.e. AccessLevelID and AccessLevel. I tried using this function in criteria but it do not work as expected/required:
Where GetAccessLevelID() is a function to acquire AccessLevelID of currently logged in user. What I want to achieve is if a user with AccessLevelID 1 is loved in, he could see all the users whereas other users can see all the users other than one with AccessLevelID equals to 1 and 2.
PS. I've already solved this issue using VBA setting different record source for different AccessLevelID through select case and SQL but I'm posting this question here out of curiosity and also I want to use IIF somewhere else.
Best Regards,
Abdullah
I've a query with only two fields from a table i.e. AccessLevelID and AccessLevel. I tried using this function in criteria but it do not work as expected/required:
SQL:
IIF(GetAccessLevelID() = 1,/[AccessLevelID], [AccessLevelID] <> 1 And [AccessLevelID] <> 2)
Where GetAccessLevelID() is a function to acquire AccessLevelID of currently logged in user. What I want to achieve is if a user with AccessLevelID 1 is loved in, he could see all the users whereas other users can see all the users other than one with AccessLevelID equals to 1 and 2.
PS. I've already solved this issue using VBA setting different record source for different AccessLevelID through select case and SQL but I'm posting this question here out of curiosity and also I want to use IIF somewhere else.
Best Regards,
Abdullah