By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Referring to a specific column in a subreport control from a textbox on the main report...

P: n/a
MLH
I have a report and on it, a subreport control

Main Report Name: rptInvoiceMain
Sub Report Name: rptInvoiceSubReport
SubReport Control Name: rptInvoiceSubReportCtl

The subreport contains 2 fields - a text field where line items
sold are listed and a currency field where the price per item
is shown. The subreport control displays these two fields
when the main report is opened.

I have a textbox on the main report where I wish to display
the total dollar amount of subreport column #2. Here is my
controlsource property setting for that textbox:

=Sum([Reports]![Orders]![rptInvoiceSubReportCtl].[Report].[ProcFee])

I'm getting an error. What have I done wrong here?
Jun 15 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
MLH wrote:
I have a report and on it, a subreport control

Main Report Name: rptInvoiceMain
Sub Report Name: rptInvoiceSubReport
SubReport Control Name: rptInvoiceSubReportCtl

The subreport contains 2 fields - a text field where line items
sold are listed and a currency field where the price per item
is shown. The subreport control displays these two fields
when the main report is opened.

I have a textbox on the main report where I wish to display
the total dollar amount of subreport column #2. Here is my
controlsource property setting for that textbox:

=Sum([Reports]![Orders]![rptInvoiceSubReportCtl].[Report].[ProcFee])

I'm getting an error. What have I done wrong here?


Hi MLH,

Normally I would do my summing on the Sub report under a group header
such as the report footer (one the sub report). I would then let the
sub report grow as needed in the main report. The control that sums
column 2 would appear at the bottom of the sub report which would then
appear on the main report from the sub report.

You could also sum the column in a new control on the sub report under
the report footer, hide it there and reference the hidden control in
another control on the main report.

If you try to sum the column the way you are doing it you will get
#Error. You must sum the column in the sub report first. then you can
try any one of the sugestions above I gave you.

Have a great day

Cilla

Jun 15 '06 #2

P: n/a
MLH
Yes, Cilla, it worked much better
performing the summation on the
subreport first. Thank-you.
Jun 15 '06 #3

P: n/a
MLH
Can you also tell me how to 'fix' the field widths
on the subreport. My subreport default view is
datasheet view. I wish to make the first of the
two columns about an inch wider.

I've tried opening the subreport in design view
and modifying the textbox control width. No luck.
I've also tried opening it in datasheet view, resizing
the fields and saving in their resized state. Didn't
do the trick either. Hmmm???
Jun 15 '06 #4

P: n/a

MLH wrote:
Can you also tell me how to 'fix' the field widths
on the subreport. My subreport default view is
datasheet view. I wish to make the first of the
two columns about an inch wider.

I've tried opening the subreport in design view
and modifying the textbox control width. No luck.
I've also tried opening it in datasheet view, resizing
the fields and saving in their resized state. Didn't
do the trick either. Hmmm???


Are you talking forms or reports. Forms have default views for sub
forms not reports?

Yes there is a way to set the width of fields in a subform that is
displayed in datasheet view. Open the sub form in datasheet view and
size your field to the size you wish then click the save button. when
you open the main form the new size of the field in the sub form should
be set.

I also have noticed if you size the field of a subform within the main
form and click the save button a couple of times it will also save the
size you set. (sometimes)

Jun 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.