Paramater Query for ALL

AndeanWayne

Registered User.
Local time
Today, 08:16
Joined
Jan 21, 2012
Messages
27
I have a query which has parameters for Buyer, Tax Year, State and County. I make my selection for each field and it works fine. I will always make a selection for Tax Year, State an County, but I need the flexibility to run the query for all Buyers. I can run the query for all buyers but it ignores the other parameters of Tax Year, State and County and gives me the entire table contents. Is there any way to get all Buyers yet have the other restrictions of the query take effect?
 
See if this example helps:
Code:
Where (Buyer = Forms!yourform!cboBuyer Or Forms!yourform!cboBuyer Is Null)
AND (TaxYear = Forms!yourform!txtTaxYear)
AND (State = Forms!yourform!cbotState OR Forms!yourform!cboState Is Null)
AND (Country = Forms!yourform!cboCountry OR Forms!yourform!cboCountry Is Null);

Pay special attention to the parentheses because they are critical when your compound condition includes both AND and OR operators.
 

Users who are viewing this thread

Back
Top Bottom