Yes/No field to show all records

lynxbci

Registered User.
Local time
Today, 18:32
Joined
Nov 27, 2007
Messages
73
Hi,
I have txt input [txt choice] which has a number (1-9) and then a query which uses the following formula to define which records are visible linked to a Yes/No field

Code:
=IIf([Forms]![frm selection]![txt choice]="4",Yes,Yes or No)

If the choice is "4" then it works fine, but if the choice is anything but 4 it still shows only the Yes items. If i change the code to

Code:
=IIf([Forms]![frm selection]![txt choice]="4",Yes,No)

Then it does show just the 'No' items but i want it to show 'everything' if the choice is not 4

Any ideas please?

thank you
 
I'm not too sure if the false part (Yes or No) of you first iif statement is valid.

If you always want to show yes and only want to show No when [txt choice]<>4 maybe you could use a condition of;

Yes or ([Forms]![frm selection]![txt choice]="4")
 
build the query over two criteria rows.

after you save it, access will convert it to a single row, if it can.


ie in one row, test the column for value 4
in another row, test the column for everything else ie null or not 4
 

Users who are viewing this thread

Back
Top Bottom