IIf in Filter Expression

I have an Invoice Report. If I pass in a CustomerID as a parameter, I want to produce the Invoice for only that Customer. Otherwise, I want to produce Invoices for all Customers of a parameter-specified Store.

So, in my filter expression, I need to say If CustID = "" Then No Filter Expression Else CustID = paramCustID.

So, my Filter Expression is

[StoreID] == [paramStore] && IIf([paramCustID] == "", "true", [CustID] == [paramCustID])

But I'm getting errors with it. What am I doing wrong?
Thanks for the help

Leave a Comment