?
Solved

Using a form to set criteria for a report

Posted on 2011-09-29
10
Medium Priority
?
249 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
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 36817683
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
ID: 36817700
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
ID: 36817785
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:SMP319
ID: 36892169
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 2000 total points
ID: 36893958
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
 
LVL 1

Author Comment

by:SMP319
ID: 36903323
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
ID: 36903328
Thanks again
0
 
LVL 1

Author Comment

by:SMP319
ID: 36903482
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
ID: 36904049
Disregard the last post. other issue caused my error. Selected solution works
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36904729
ok
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

771 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