Show either True, False or both True and False in query (1 Viewer)

Turvoll

New member
Joined
Nov 24, 2011
Messages
5
Hey
In a materials table I have a Yes/No field called Reserved used to indicate if the material is reserved for a contract or not.
When looking at the inventory list, I have 3 opion buttons called Reserved, NotReserved and ShowAll. The options are given the values -1, 0 and 1 respectivly. The query runs after updating / chosing a value.
I am trying to have the query show all if the value is 1 (ShowAll). Have using the Iif function but have not succeded. The query runs OK as long as the value -1 or 0 is passed on to the query.

Anyone that can help?
 

Turvoll

New member
Joined
Nov 24, 2011
Messages
5
OK, here is the Iif statement:

Iif(Forms![MatList]![ReservedStatus]=1;Like "*";Forms![MatList]![ReservedStatus])
 

vbaInet

AWF VIP
Joined
Jan 22, 2010
Messages
26,374
Code:
LIKE IIf([Forms]![MatList]![ReservedStatus]=1, "*", [Forms]![MatList]![ReservedStatus])
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom