Pass Parameter to Sub-Report

G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top