?
Solved

Apply filter to report already filtered

Posted on 2014-04-05
2
Medium Priority
?
526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 39979915
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
ID: 39979925
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

764 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