Link to home
Start Free TrialLog in
Avatar of SMP319
SMP319Flag for United States of America

asked on

Filter Report

I am looking to copy a report i had created and apply filters to each new report. I have 2 fields "Division" and "Organization". I would like to create the reports as follows by applying the filter
Division 1 Organization 1
Division 1 Organization 2
Division 2 Organization 1

I have completed alot of work on the final report and would like to keep away from redoing queries and creating new reports.
Looking for instructions on setting the filter on a report and the expression that will yiled the results above.
Avatar of dqmq
dqmq
Flag of United States of America image

In an absolute sense, it looks like this:
docmd.openreport "YOURREPORTNAME",,,"Division = 1 and Organization = 1"


However, if you are selecting division and Organization from dropdowns on a form before running the report then you can do it like this:

docmd.openreport "YOURREPORTNAME",,,"Division = " &  me.comboDivision  & " and Organization = " & me.comboOrganization

Avatar of SMP319

ASKER

cant seem to get it to work, can you provide details on how and where to apply the code to the report for your first option
Avatar of Jeffrey Coachman

<cant seem to get it to work>
Then can you post What you tried?

Actually it looks like you need "Or" not "And":

Something like this:
"(Division= 1 Or Division=2) Or (Organization =1 Or Organization =2)"


JeffCoachman
I was thinking you wanted to open the report programmatically, like from a macro or from a form (as opposed to opening it from the database navigation window.  How do you intend to open the report?
Avatar of SMP319

ASKER

i planned to open from the navigation  window
Avatar of SMP319

ASKER

Here is a screen shot. I am new to access. i was trying to add the filter to the report to just show a certain division and Organization in the report.
Screen-shot.xlsx
ASKER CERTIFIED SOLUTION
Avatar of dqmq
dqmq
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SMP319

ASKER

So instead of crfeating multiple reports i will create multiple macros to show my results. I am interested in understanding how to do this using the form as you had mentioned. I will post another question. Thanks for you help
Yes. Multiple macros instead of multiple reports.