Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 15th, 2006, 06:35 PM
MLH
Guest
 
Posts: n/a
Default Referring to a specific column in a subreport control from a textbox on the main report...

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?

  #2  
Old June 15th, 2006, 06:55 PM
Cilla
Guest
 
Posts: n/a
Default Re: Referring to a specific column in a subreport control from a textbox on the main report...

MLH wrote:[color=blue]
> 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?[/color]

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

  #3  
Old June 15th, 2006, 07:05 PM
MLH
Guest
 
Posts: n/a
Default Re: Referring to a specific column in a subreport control from a textbox on the main report...

Yes, Cilla, it worked much better
performing the summation on the
subreport first. Thank-you.
  #4  
Old June 15th, 2006, 07:05 PM
MLH
Guest
 
Posts: n/a
Default Re: Referring to a specific column in a subreport control from a textbox on the main report...

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???
  #5  
Old June 15th, 2006, 07:45 PM
Cilla
Guest
 
Posts: n/a
Default Re: Referring to a specific column in a subreport control from a textbox on the main report...


MLH wrote:[color=blue]
> 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???[/color]

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)

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.