SubReport not using Form calling parameters

zoria8

New member
Local time
Yesterday, 21:56
Joined
May 16, 2004
Messages
7
Good evening,

Thanks in advance for any assistance!

I have a report called Recent_Update_Items, within this report is a subreport Recent_Notes_subreport (subreport has 3 fields: Assignee, Note Date, Note). The reports are linked by the Project ID. The main report contains information about a Project and the subreport contains all of the notes on a Project that an Assignee as entered.

The reports are based on one source query.

I have a form that allows the user to specify if they want to see all of the notes entered after a certain date or notes entered between two dates. I have modified the code of the Open Report command button to determine which they want to do, and then assisgned the condition to a variable that is used as the where condition of the DoCmd.OpenReport method.

Problem: When the command button is clicked the main report only shows records with a note during the time frame specified (which is correct), however, the subreport lists all the notes attached to the Project ID, not just those within (or after) the specified dates.

Need more info, let me know! Any ideas or help is appreciated!
 
I would have thought that linking the Child and Master fields would have worked, but then, I'm not a report guru.
Perhaps you could apply the same "where" criteria to your subform's Filter property?
Don't quote me on the syntax, it's just an idea...
Code:
'After applying the where criteria to the report...
With Reports![ReportName]![SubReportControlName].Report
     .Filter = .Parent.Report.Filter
     .FilterOn = True
End With
 
Last edited:
Thank you for the idea, but it didn't work. I get the following error: "You entered an expression that has an invalid reference to the property Form/Report. The property may not exist or may not apply to the object you specified."

I tried a bunch of things with this and none are working. And yes, I thought linking the two would make it work off the same criteria, however it does not.

One thing, if I enter the values I want (i.e. >#3/1/2005# or Between #3/1/2005# and #3/15/2005#) directly into the criteria of the query field, both Master and subreport work correctly.

Any other thoughts or ideas?

Thank you very much!
 

Users who are viewing this thread

Back
Top Bottom