Solved

Apply filter to report already filtered

Posted on 2014-04-05
2
517 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 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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 …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

724 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