Filter Query Based on user permissions (1 Viewer)

yeasir01

Registered User.
Local time
Today, 07:14
Joined
Mar 26, 2018
Messages
67
Hello All,

I tried using the following in the criteria section of the NO_ACCESSS column which did not yield the desired results. I am not familiar with SQL so I tried to accomplish this using the expression builder, any help would be greatly appreciated!

Code:
IIF (FORM!MAIN!LEVEL_ID=1, Like ("*"), False)

What I need the query to do is look at the value of a form if
the level_ID=1 then show all records in query otherwise only display records where No_access is equal to false.



Here is the SQL statement for reference

Code:
SELECT L_VAULT_TBL.STORE_ID, L_VAULT_TBL.ID, L_VAULT_TBL.DESCRIPTION, L_VAULT_TBL.ACCOUNT_NUM, L_VAULT_TBL.WEB_ADDRESS, L_VAULT_TBL.NO_ACCESSS
FROM L_VAULT_TBL;
 

Attachments

  • screenshot.png
    screenshot.png
    62.3 KB · Views: 35

June7

AWF VIP
Local time
Today, 06:14
Joined
Mar 9, 2014
Messages
5,423
The comparison operators in criteria cannot be dynamic. LIKE is an operator.

LIKE IIf(Form!Main!Level_ID=1, "*", False)
 

yeasir01

Registered User.
Local time
Today, 07:14
Joined
Mar 26, 2018
Messages
67
The comparison operators in criteria cannot be dynamic. LIKE is an operator.

LIKE IIf(Form!Main!Level_ID=1, "*", False)

You're Awesome! Thank you this helps me tremendously.
 

Users who are viewing this thread

Top Bottom