Solved

Using a form to set criteria for a report

Posted on 2011-09-29
10
245 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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 500 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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 …

786 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