Senin, 01 Juni 2015

Re: [MS_AccessPros] What's the best way to filter a sub form?

 

Adam-


Just a guess, but add a Link Master / Link Child filter in the subreports on ProjectType.  It'll probably work when the outer report is filtered, but may screw up your report on all records because the subreports will be filtered on the Project Type of the last record.  Hmmmm.

Not sure that you can set the Filter and FilterOn properties of the subreports in the Open event of the outer report.  You could also try testing Me.Filter in the report Open event, and if it's not empty, then replicate it in the subreports.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jun 1, 2015, at 6:40 PM, runuphillracing@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I have a project tracking database. A report lists all reports for a specified time frame. That time frame criteries is in the source query: WHERE ((([tbl_Project Tracking].[START DATE]) Between [Forms]![frmNonITReports].[DateBeg] And [Forms]![frmNonITReports].[DateEnd]))


There are two summary subreports at the end - one showing count by project type, the other by project person. They use the same source query as the main report, just grouped differently and showing only the summaries.


I need to report by selected project types. That's easy on the main report - I add "[PojectType] = 8" to the Where condition of DoCmd.OpenReport if a checkbox is checked on the form requesting the report. I'm not sure how to get the summary sub reports to use the same filter. Do I use an OnLoad event for the main form, the subform, do I add the filter to the main or sub via the VBA code that opens the report?


Adam


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar