Solved

Apply filter to report already filtered

Posted on 2014-04-05
2
516 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 84

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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 …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

734 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