Subreport

G

Guest

I have a report with a sub report in the detail section. A value in the
detail section is aimed to tell how many records the sub report returns. I
would like to write the sub reports Record Source in the main report and send
it by code to the sub report (SELECT TOP # Product, OrderDate FROM tblTest
ORDER BY OrderDate DESC;).
I have tried a lot to finish properly but I can't. Perhaps have I taken a
wrong way to solve the problem. Have you any idea?

Problem: I need to print a list of customers. For few customers do I need 1
sub record while I might need 200 for others.

Thanks,
Arni L
 
R

Rick Brandt

Arni said:
I have a report with a sub report in the detail section. A value in
the detail section is aimed to tell how many records the sub report
returns. I would like to write the sub reports Record Source in the
main report and send it by code to the sub report (SELECT TOP #
Product, OrderDate FROM tblTest ORDER BY OrderDate DESC;).
I have tried a lot to finish properly but I can't. Perhaps have I
taken a wrong way to solve the problem. Have you any idea?

Problem: I need to print a list of customers. For few customers do I
need 1 sub record while I might need 200 for others.

Thanks,
Arni L

I'm not positive, but I don't think you can set the RecordSource property of a
subreport from an event in the main report. You can use code in the subreport
that refers to controls in the main report, but even then I think you are
limited to using the subreport's Open event. Many report properties are fixed
once printing begins.
 

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