Jules Decouls
New member
- Local time
- Today, 01:41
- Joined
- Feb 8, 2017
- Messages
- 2
Hi
I am trying to use an iif statement to limit the results of a query based on the value of a record. This is the criteria in the query field CTRID (centre ID)
=IIf([Forms]![POMSfrmMainMenu]![Centre]=0,>0,[Forms]![POMSfrmMainMenu]![Centre])
when users login their login details are stored in a field called CTRID. Admin users have a value of 0, other users have a value of 1 or 2 or 3 etc. which relates to their particular store. the query shows orders for all stores, but I want the user to only see their own store orders unless they are an admin user, then I want them to see all orders.
If I put >0 in the criteria for the query, I see all stores. If I put the criteria as
[Forms]![POMSfrmMainMenu]![Centre]) then i limit the view to only these stores, but if i use the expression above - I return no records.
how can I put the >0 into the iff statement so that it works. I've tried putting ">0" but thsi doesnt work.
Any help would be much appreciated!
Thanks
I am trying to use an iif statement to limit the results of a query based on the value of a record. This is the criteria in the query field CTRID (centre ID)
=IIf([Forms]![POMSfrmMainMenu]![Centre]=0,>0,[Forms]![POMSfrmMainMenu]![Centre])
when users login their login details are stored in a field called CTRID. Admin users have a value of 0, other users have a value of 1 or 2 or 3 etc. which relates to their particular store. the query shows orders for all stores, but I want the user to only see their own store orders unless they are an admin user, then I want them to see all orders.
If I put >0 in the criteria for the query, I see all stores. If I put the criteria as
[Forms]![POMSfrmMainMenu]![Centre]) then i limit the view to only these stores, but if i use the expression above - I return no records.
how can I put the >0 into the iff statement so that it works. I've tried putting ">0" but thsi doesnt work.
Any help would be much appreciated!
Thanks