SubReport - Two Questions

M

mromyn

Hi!

The first question is: I have a total in a report, and another total in the
subreport. I need to get the difference between them. I have: =
[rptBudgetAmount] - Reports![PDMO_Budget_Q_Sub]![srptTotal] but it won't
work, I get a #Name in the field.
I also cannot get the total in the subreport [srptTotal] to show up in the
text field on the report with Control = [srptTotal]. I am not sure what is
going on here -- any help would be great!

My second question is: I have a subreport linked to each category in the
report. In some cases there are no subreport items for the category. The
report seems to be reserving the area for the sub report. Is there a way to
automatically resize it based on the data in the subreport?

Thanks!
Mel
 
J

Jeff Boyce

The following:

Reports![PDMO_Budget_Q_Sub]![srptTotal]

tells Access to start looking in the subreport named [srptTotal] on the main
report named [PDMO_Budget_Q_Sub].

Start looking, that is, but never says what field to look at in the
subreport.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

mromyn

How can I tell it to look in the field sprtTotal?

I just tried: =[Report]![PDMO Budget Totals]![PDMO_Budget_Q_Sub]![srptTotal]

and that's not working either. Is there a way to get the value of srptTotal
into the main report?

Jeff Boyce said:
The following:

Reports![PDMO_Budget_Q_Sub]![srptTotal]

tells Access to start looking in the subreport named [srptTotal] on the main
report named [PDMO_Budget_Q_Sub].

Start looking, that is, but never says what field to look at in the
subreport.

Regards

Jeff Boyce
Microsoft Office/Access MVP



mromyn said:
Hi!

The first question is: I have a total in a report, and another total in
the
subreport. I need to get the difference between them. I have: =
[rptBudgetAmount] - Reports![PDMO_Budget_Q_Sub]![srptTotal] but it won't
work, I get a #Name in the field.
I also cannot get the total in the subreport [srptTotal] to show up in the
text field on the report with Control = [srptTotal]. I am not sure what
is
going on here -- any help would be great!

My second question is: I have a subreport linked to each category in the
report. In some cases there are no subreport items for the category. The
report seems to be reserving the area for the sub report. Is there a way
to
automatically resize it based on the data in the subreport?

Thanks!
Mel
 
M

mromyn

I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?



Jeff Boyce said:
The following:

Reports![PDMO_Budget_Q_Sub]![srptTotal]

tells Access to start looking in the subreport named [srptTotal] on the main
report named [PDMO_Budget_Q_Sub].

Start looking, that is, but never says what field to look at in the
subreport.

Regards

Jeff Boyce
Microsoft Office/Access MVP



mromyn said:
Hi!

The first question is: I have a total in a report, and another total in
the
subreport. I need to get the difference between them. I have: =
[rptBudgetAmount] - Reports![PDMO_Budget_Q_Sub]![srptTotal] but it won't
work, I get a #Name in the field.
I also cannot get the total in the subreport [srptTotal] to show up in the
text field on the report with Control = [srptTotal]. I am not sure what
is
going on here -- any help would be great!

My second question is: I have a subreport linked to each category in the
report. In some cases there are no subreport items for the category. The
report seems to be reserving the area for the sub report. Is there a way
to
automatically resize it based on the data in the subreport?

Thanks!
Mel
 
J

John Spencer

Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
M

mromyn

Thanks John -

Unfortunatley that did not work. It did seem to recognize the subreport
(there was no longer a pop up box asking for the parameter) but it still will
not show the value from the srptTotal field. Any other sugestions?

John Spencer said:
Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?
 
J

John Spencer

NOTHING else comes to mind. Are you sure there is a value in srptTotal?
Are you showing it in the subreport so you can see if there is
something there?

In which section of the subreport is the srpttotal located? It cannot
be in a PAGE header or footer.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Thanks John -

Unfortunatley that did not work. It did seem to recognize the subreport
(there was no longer a pop up box asking for the parameter) but it still will
not show the value from the srptTotal field. Any other sugestions?

John Spencer said:
Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?
 
M

mromyn

Yes there is a value in srptTotal. I can do the reverse and have a total from
the report in the subreport, just not the total from the subreport in the
report.

It is in the Report Footer of the subreport and the Category Header of the
report. I've tried moving it but still no luck. I woudl somebody has to
have done this before but have search for examples and haven't found anything.

John Spencer said:
NOTHING else comes to mind. Are you sure there is a value in srptTotal?
Are you showing it in the subreport so you can see if there is
something there?

In which section of the subreport is the srpttotal located? It cannot
be in a PAGE header or footer.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Thanks John -

Unfortunatley that did not work. It did seem to recognize the subreport
(there was no longer a pop up box asking for the parameter) but it still will
not show the value from the srptTotal field. Any other sugestions?

John Spencer said:
Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?
 
J

John Spencer

I'm stuck. Hopefully someone that is more talented in working with
reports and sub-reports will be able to provide a solution. If not, you
might want to re-start this discussion with a new posting.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Yes there is a value in srptTotal. I can do the reverse and have a total from
the report in the subreport, just not the total from the subreport in the
report.

It is in the Report Footer of the subreport and the Category Header of the
report. I've tried moving it but still no luck. I woudl somebody has to
have done this before but have search for examples and haven't found anything.

John Spencer said:
NOTHING else comes to mind. Are you sure there is a value in srptTotal?
Are you showing it in the subreport so you can see if there is
something there?

In which section of the subreport is the srpttotal located? It cannot
be in a PAGE header or footer.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Thanks John -

Unfortunatley that did not work. It did seem to recognize the subreport
(there was no longer a pop up box asking for the parameter) but it still will
not show the value from the srptTotal field. Any other sugestions?

:

Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?
 
M

mromyn

Thanks for trying!!!

John Spencer said:
I'm stuck. Hopefully someone that is more talented in working with
reports and sub-reports will be able to provide a solution. If not, you
might want to re-start this discussion with a new posting.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Yes there is a value in srptTotal. I can do the reverse and have a total from
the report in the subreport, just not the total from the subreport in the
report.

It is in the Report Footer of the subreport and the Category Header of the
report. I've tried moving it but still no luck. I woudl somebody has to
have done this before but have search for examples and haven't found anything.

John Spencer said:
NOTHING else comes to mind. Are you sure there is a value in srptTotal?
Are you showing it in the subreport so you can see if there is
something there?

In which section of the subreport is the srpttotal located? It cannot
be in a PAGE header or footer.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
Thanks John -

Unfortunatley that did not work. It did seem to recognize the subreport
(there was no longer a pop up box asking for the parameter) but it still will
not show the value from the srptTotal field. Any other sugestions?

:

Yes, it is possible to reference a sub-report's control in the main report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the sub-report
control. The control name does not have to be the same name as the name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the subreport. Is it
possible to have a value from the subreport in the report?
 
J

Jeff Boyce

Consider re-posting to the access.reports newsgroup.

Regards

Jeff Boyce
Microsoft Office/Access MVP


mromyn said:
Thanks for trying!!!

John Spencer said:
I'm stuck. Hopefully someone that is more talented in working with
reports and sub-reports will be able to provide a solution. If not, you
might want to re-start this discussion with a new posting.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Yes there is a value in srptTotal. I can do the reverse and have a
total from
the report in the subreport, just not the total from the subreport in
the
report.

It is in the Report Footer of the subreport and the Category Header of
the
report. I've tried moving it but still no luck. I woudl somebody has
to
have done this before but have search for examples and haven't found
anything.

:

NOTHING else comes to mind. Are you sure there is a value in
srptTotal?
Are you showing it in the subreport so you can see if there is
something there?

In which section of the subreport is the srpttotal located? It cannot
be in a PAGE header or footer.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
Thanks John -

Unfortunatley that did not work. It did seem to recognize the
subreport
(there was no longer a pop up box asking for the parameter) but it
still will
not show the value from the srptTotal field. Any other sugestions?

:

Yes, it is possible to reference a sub-report's control in the main
report.

Perhaps the following will work for you.

=Reports![PDMO Budget Totals]!PDMO_Budget_Q_Sub.Report!srptTotal

Also, make sure that "PDMO_Budget_Q_Sub" is the name of the
sub-report
control. The control name does not have to be the same name as the
name
of the report you are using as the sub-report.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================


mromyn wrote:
I can't get this to work: =Reports![PDMO Budget
Totals].PDMO_Budget_Q_Sub!srptTotal

But I can do the reverse and have the report value in the
subreport. Is it
possible to have a value from the subreport in the report?
 
J

James A. Fortune

mromyn said:
Hi!

The first question is: I have a total in a report, and another total in the
subreport. I need to get the difference between them. I have: =
[rptBudgetAmount] - Reports![PDMO_Budget_Q_Sub]![srptTotal] but it won't
work, I get a #Name in the field.
I also cannot get the total in the subreport [srptTotal] to show up in the
text field on the report with Control = [srptTotal]. I am not sure what is
going on here -- any help would be great!

My second question is: I have a subreport linked to each category in the
report. In some cases there are no subreport items for the category. The
report seems to be reserving the area for the sub report. Is there a way to
automatically resize it based on the data in the subreport?

Thanks!
Mel

When I need to do something like that I usually create a hidden text box
on the report. For example:

rptMainReport
txtAmount (hidden)
ControlSource:
=[rptSubReportName].[Report]![txtItemAmount]

txtSumAmountAndAddSubformAmount:
ControlSource:
=Format(Sum([AmountFieldFromReportRecordSourceSQL])+IIf(Reports("rptMainReport").[Controls]("rptSubReportName").[Report].[HasData],Nz([txtItemAmount].[Value]),0),"$#,##0.00")

Hopefully, some of the syntax shown here will provide what you need. Be
careful not to put a space or a carriage return in if line wrap occurs.

For the second question, I usually make the Subreport area very thin,
yet set the CanGrow property to 'Yes'. I think that will make it so
that the main report will only use the space if it needs it.

James A. Fortune
(e-mail address removed)
 

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