IIF function paired with Between...And

utmigs

New member
Local time
Yesterday, 23:01
Joined
Nov 17, 2004
Messages
6
I am trying to build a query that will display certain filtered data from a table. I only want the query to pick up items for filtering that are checked by a corresponding check box. I also need to use a range of values as query criteria. For example:

I have a field named "Price". The query will pull from an input form ("InputForm") the range of prices ("MinPrice" and "MaxPrice"), but only if the check box ("Check0") next to the range is selected. I tried the following criteria:

IIF([Forms]![InputForm]![Check0]=True, Between [Forms]![InputForm]![MinPrice] And [Forms]![InputForm]![MaxPrice], IsNull)

That didn't work. Please help if you can. Thank you.
 
like this??

Assuming that you have a form that is based upon a table named tblPrice, with a field named Price [currency], and another field named Check [yes/no]

SELECT
tblPrice.Price

FROM
tblPrice

WHERE
(((tblPrice.Price)

Between
[Please enter min price]

And
[Please enter max price])

AND
((tblPrice.CheckBox)=-1));

HTH :cool:
 
That worked. Thanks a lot for your help. I really appreciate it.
 

Users who are viewing this thread

Back
Top Bottom