Solved

Using a form to set criteria for a report

Posted on 2011-09-29
10
244 Views
Last Modified: 2012-06-27
As mentioned in the related question, i would like to understand how to complete the same task using a form to chose the criteria
0
Comment
Question by:SMP319
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
Comment Utility
1.) Use a Select Query for the Record Source of your report.
2.) Open your form.
3.) Pass the parameter from your form to the report as shown below ....

On the Criteria line of the field in your query (say Trx_Date) enter

Between Forms!MyForm!TxtStartDate And Forms!MyForm!TxtEndDate


ET
0
 
LVL 19

Expert Comment

by:Eric Sherman
Comment Utility
Also, you can open your Form in Dialog mode, have the user select the parameters, then minimize the form, print the report and close the Form with the Report's OnClose Event.

ET
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
This question has been addressed hundreds of times here.

There are quite a few different approaches to this, depending on your exact needs and skill level.

See here as a start:
http://www.google.com/search?q=site%3Awww.experts-exchange.com+microsoft+Access+filter+report++from+by+a+form
0
 
LVL 1

Author Comment

by:SMP319
Comment Utility
Thanks for the reponses. I ended up updating the code from my previous question to look at the value from the combo boxes in the form.
[Division]=[Forms]![Organization Selection]![Combo9] And [Organization]=[Forms]![Organization Selection]![Combo13]

my only issue with this is that once the report opens, i need to close the report and then rerun the form before the values will update in the report. Is there a way to have multiple reports open based on different criteria in the form. or at the least have the report update as soon as the form is updated.

Here is a copy of the database
Account-Project-Management.accdb
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
Comment Utility
First, ...Is your original issue here "Filtering the report from a form", now resolved?
Yes or No?

"Is there a way to have multiple reports open based on different criteria in the form. "
Yes but it involves "Instantiating" the form.
This is a whole other topic.

A simple alternative would be to simply close the Report when the form gets the focus.
Then make your new selections, then re-open the report with the button.
Put code like this on the "Activate" event of the form:
    DoCmd.Close acReport, "Research Project Margin"

JeffCoachman

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:SMP319
Comment Utility
I resolved my original question by altering the code from my Related question. So yes. Can i give myself the points :). But this created another question which you had resolved.  I will award you the points. Thanks for the work around
0
 
LVL 1

Author Closing Comment

by:SMP319
Comment Utility
Thanks again
0
 
LVL 1

Author Comment

by:SMP319
Comment Utility
on my initial test the report closed. however I noticed afterwards that the form is not clearing out the previuous request so when i change my selection i get no results. I have to close the database and reopen. is there code to clear the selection in the form
0
 
LVL 1

Author Comment

by:SMP319
Comment Utility
Disregard the last post. other issue caused my error. Selected solution works
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
ok
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now