If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access Form values to Report to Query
OK guys, I'm stumped and need some help.
I am writing some reports for a client. I started by writing a query which is used for all the reports. The query prompts for start and end date and a value to filter by from a table or 'ALL' returns an unfiltered record set. The report runs just fine and prompts for the values. The client now wants to select the start and end dates from a calendar function rather than enter them directly and select the filter from a drop down box so I have built an unbound form with two calendar controls, the filter with drop down and a tick box to say don't filter which sets enabled = false on the filter I have also put a hidden text field on the form which takes the filter value or 'ALL' if the tickbox is true. I can get the query to correctly filter by the parameters on the form by changing the selection criteria to specifically look at the form but I may want to use the query again with a different form. What I really want to do is pass the form values through to the report and have the filter function on the report override the query parameters but I cant make it work. Any ideas what i'm doing wrong and what is the best alternative. I'm thinking, maybe take the filter criteria out of the main query and build another query specifically for the report that takes the values from the form but this is a cop out as far as I am concerned. We are using Access 2003 on XP Pro SP2 Thanks guys Obiron |
#2
|
|||
|
|||
Access Form values to Report to Query
Take the criteria out of the query and use the WhereCondition parameter
in the DoCmd.OpenReport method. Don't forget to set the FilterOn property to Yes. HTH, Barry |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Access Report | Marilyn | New Users | 5 | March 9th, 2006 06:03 AM |
Parameter thru Form Dialog Box for REPORT | Sandy | Setting Up & Running Reports | 16 | January 10th, 2006 11:06 AM |
Has anyone seen this behaviour? What might it be? | tw | General Discussion | 4 | June 30th, 2005 03:23 PM |
Need Help In Printing Current Record in Specific Report | RNUSZ@OKDPS | Setting Up & Running Reports | 1 | May 16th, 2005 09:06 PM |
Display Parameter from Form on Report | sara | Setting Up & Running Reports | 10 | July 19th, 2004 04:54 PM |