Let’s thing you have a requirement that if Login name is DUMMY, show only records in which name field equal to “3Com” otherwise show all the records which means you don’t want to make a filtering if Login Name is not equal to DUMMY.
You can not use “IIf” function without else part like below becasue of it is giving syntax error.
IIf((LoginName() = “DUMMY”), [Name]=”3Com”)
But you can not use “IIf” function like this below which is giving syntax error.
Instead of this you can do a trick this using “Id” column which is always not null and active.
IIf((LoginName() = “DUMMY”), [Name]=”3Com”,[Id] IS NOT NULL)
Sure, it has some performance impact but i can not find better way
What about you?