send value to query

chewy

SuperNintendo Chalmers
Local time
Today, 15:21
Joined
Mar 8, 2002
Messages
581
I have a query which is made from choosing from two different list boxes on a form. I have lstReason which queries by the reason that is selected in the list box. I have a check box chkAll which I want when this is checked to clear the criteria in the query. But Im not sure how to send this value.

Any ideas? Im sure this is simple.
 
what you need to do is make the criteria for the query a little bit more complicated by using the IIF statement.

Basically you want something like this.

IIF(CheckBoxOnThe Form = -1, "Like '*'",ListBoxValue)

I think that should work for you though you may have to play with the Like statement a bit.
 
im not really sure how to use the iif. I cant figure that out. Does it just give you a value like 0 or 1 or something? Tha tcheck box is not in the query. Should it be?
 
the IIF statement is used as follows

IIF(Condition,True,False)

it is in the help system within access.
 
there has to be a way when it is checked to just send a parameter to qryEmployee with the field ReasonId in the query to null or whatever it needs to display all the records
 

Users who are viewing this thread

Back
Top Bottom