Apply filter

Hello guys,
I have problem with my project and I need help with the solution.

1. Query name “A” has column1...column10
2. Form name “B” with subform “C”

In the subform “C” is connected source as query “A”...

My question is how I may update query “A” results if I want to use default filter (any search box any combobox) from all columns in the subform “C”
I thought that subform “C” is the same as query “A” but If I use filter in column1 in subform “C” then not update filtered result in query “A”

with one column is not problem, for example if in the query “A” for column1 give criteria Forms!B!C!column1 then from form is function update query result... but I can’t combine more criteria for each column in query “A”

Is possible please to used column filter for update query?

-In query “A” re the all data
-Users can use filter for each column in subform “C” and then export filtered data to excel with command button or print.

thanks for reply and sorry for my english ;)
Johny RamboAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Filters that you apply using the interface tools, do NOT affect the underlying query.  If you want to have the query respect the filters, you need to build your own filtering interface.  Then you would change the  WHERE clause of the query:

Select ...
From ...
Where fld1 = Forms!yourform!cbofld1 AND fld2 = Forms!yourform!cbofld2 AND fld3 = Forms!yourform!cbofld3 AND .....

Then when you export the query to Excel, the WHERE clause will filter the data as you expect it to.
Johny RamboAuthor Commented:
So in my case:

query = A
form = B
subform (source A) in form B = C

SELECT A.field1; A.field2 ... A.field10 FROM A WHERE A.field1 = Forms!B!C!field1 and A.field2 = Forms!B!C!field2 ... A.field10 = Forms!B!C!field10;

here is the same problem, if I use it only for one field then is update result query right... if I combine filter in fields then is not right.

I tried it with or but this not function too...
if I combine filter in fields then is not right.
What does "not right" mean?  

Are you using only AND as the relational operator?
Are all of the variables always provided or are some of them optional?  If some are optional, you can use this pattern.

WHERE (A.field1 = Forms!B!C!field1 OR Forms!B!C!field1 is Null) and (A.field2 = Forms!B!C!field2 OR Forms!B!C!field2 Is Null) ... (A.field10 = Forms!B!C!field10 Is Null)

Once an expression contains AND's and OR's, you must use parentheses to control the order of precedence. and force Access to evaluate the expression as you want it to be evaluated.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.