Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using a form to set criteria for a report

Posted on 2011-09-29
10
Medium Priority
?
254 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
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
Technology Partners: 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!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

864 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