Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Apply filter to report already filtered

Posted on 2014-04-05
2
Medium Priority
?
532 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

636 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