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

Turvoll

New member
Local time
Yesterday, 20:49
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?
 

vbaInet

AWF VIP
Local time
Today, 04:49
Joined
Jan 22, 2010
Messages
26,374
So let's see the IIF() function that you tried.
 

Turvoll

New member
Local time
Yesterday, 20:49
Joined
Nov 24, 2011
Messages
5
OK, here is the Iif statement:

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

vbaInet

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

Users who are viewing this thread

Top Bottom