Same SubReport

D

DS

I want to use the same Sub-Report on two different main reports,however; I
don't know how to reference the main report. I don't want to build two
seperate Sub-Reports.

=[Reports]![rptCashOutServer].[rptCashOutPayments]![PayName] & " " & "Ttl"

=[Reports]![rptCashOutCashier].[rptCashOutPayments]![PayName] & " " & "Ttl"

New Code?
=[Reports]![??????????].[rptCashOutPayments]![PayName] & " " & "Ttl"

Any help appreciated,
Thanks
DS
 
M

Marshall Barton

DS said:
I want to use the same Sub-Report on two different main reports,however; I
don't know how to reference the main report. I don't want to build two
seperate Sub-Reports.

=[Reports]![rptCashOutServer].[rptCashOutPayments]![PayName] & " " & "Ttl"

=[Reports]![rptCashOutCashier].[rptCashOutPayments]![PayName] & " " & "Ttl"

New Code?
=[Reports]![??????????].[rptCashOutPayments]![PayName] & " " & "Ttl"



If that text box expression is in the same subreport as the
PayName text box, you don't need all that. Just use:
=PayName & " " & "Ttl"

If that text box expression is in a different subreport from
the PayName text box, then you can use:
=Parent.rptCashOutPayments.Report!PayName & " " & "Ttl"
Note the use of the Report property. While it was not
required in older versions of Access, it is in newer
versions.
 
D

DS

Great, thank you Marshall,
that was very informative.
Works well.
DS
Marshall Barton said:
DS said:
I want to use the same Sub-Report on two different main reports,however; I
don't know how to reference the main report. I don't want to build two
seperate Sub-Reports.

=[Reports]![rptCashOutServer].[rptCashOutPayments]![PayName] & " " & "Ttl"

=[Reports]![rptCashOutCashier].[rptCashOutPayments]![PayName] & " " &
"Ttl"

New Code?
=[Reports]![??????????].[rptCashOutPayments]![PayName] & " " & "Ttl"



If that text box expression is in the same subreport as the
PayName text box, you don't need all that. Just use:
=PayName & " " & "Ttl"

If that text box expression is in a different subreport from
the PayName text box, then you can use:
=Parent.rptCashOutPayments.Report!PayName & " " & "Ttl"
Note the use of the Report property. While it was not
required in older versions of Access, it is in newer
versions.
 

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