Pass Parameter to Sub-Report

M

MartyO

Hi there,

When I pass a parameter to my Main Report in the Where clause of the
DoCmd.OpenReport, the subreport does not recognize it. Where When,How, do I
pass that same parameter(s) to my subreport?

Thanks in advance for your help!!
Marty
 
M

MartyO

Sorry, I don't know how/where the me.parent.openargs is used. I typically
have a button on a form or a command on the menu that triggers the report to
print. I do that with a DoCmd.OpenReport "rptName", "CustomerID ='" &
stCustId & "'". The report opens, and I want the filter passed to the
subreport as well.

Would you mind being more specific about the OpenArgs?
Thanks so much!
Marty
 
O

Ofer

In that case, the main report open with a filter "CustomerID ='" &
stCustId & "'"
If that works, then all you need to do is link the sub report to the report
using the child and parent properties on the sub report control on the report.
Define the field name of the CustomerID of the main report in the parent
and the CustomerID field name in the subreport in the child section
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
Top