Solved

Apply filter to report already filtered

Posted on 2014-04-05
2
502 Views
Last Modified: 2014-04-05
Hi,
Trying to filter a report that is already filtered based on a optionframe    

The report is based on a shipments query which includes all the fields from the shipments table and opens unfiltered (me.filter="")
The user clicks a customer option frame on the opened report to filter by customer.
There are buttons on the report relating to pack types which I want to be able to apply a second filter on the already filtered report.

this code

Me.Filter = "fkPackTypeID = 1" And "fkCustID = " & Me.frameCustomer
Me.FilterOn = True

doesn't seem to work.

I haven't tried using a form to 'drive' the report, as I want the user to be able to do the filtering on the already open report. Am I making it harder than it needs to be? Or have I got the ampersand wrong again?

Any help would be appreciated
0
Comment
Question by:Stephen Byrom
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
Try this instead:

Me.Filter = "fkPackTypeID = 1 AND fkCustID = " & Me.frameCustomer
Me.FilterOn = True

If the value of 1 is dynamic - that is, you get it from your option group - then you could do this:

Me.Filter = "fkPackTypeID = " & Me.YourOptionGroup & " AND fkCustID = " & Me.frameCustomer
Me.FilterOn = True
0
 
LVL 1

Author Closing Comment

by:Stephen Byrom
Comment Utility
Thanks a lot,
I knew it would be something to do with the apostrophes and ampersands. I just can't get the hang of that.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now