473,747 Members | 2,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

MLH
I have a report and on it, a subreport control

Main Report Name: rptInvoiceMain
Sub Report Name: rptInvoiceSubRe port
SubReport Control Name: rptInvoiceSubRe portCtl

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]![rptInvoiceSubRe portCtl].[Report].[ProcFee])

I'm getting an error. What have I done wrong here?
Jun 15 '06 #1
4 3285
MLH wrote:
I have a report and on it, a subreport control

Main Report Name: rptInvoiceMain
Sub Report Name: rptInvoiceSubRe port
SubReport Control Name: rptInvoiceSubRe portCtl

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]![rptInvoiceSubRe portCtl].[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
MLH
Yes, Cilla, it worked much better
performing the summation on the
subreport first. Thank-you.
Jun 15 '06 #3
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1411
by: Josh Nikle | last post by:
I have a subreport that displays the addresses of suppliers. Its source table has fields for the name, street, city/state, and ZIP code for easier querying. However, for display purposes, I put the city/state and ZIP together and put that value in txtCityAndState. When I run the report, the print preview looks perfect. When I print it, though, txtCityAndState is blank. I've tried putting the same code I used to fill this textbox in the...
9
2827
by: Downstreamer | last post by:
Design is as follows: A form for the user to input criteria to be used as the where part of the report's recordsource. This includes a multiselect list box as part of the criteria selection. The report is generated from a button on this form. In the button's onclick event a where clause is built and assigned to a public variable. Because of the multiselect listbox I use IN as part of the where clause, for example, sqlstr = " ...
1
7665
by: Kirsty Ryder | last post by:
Hi, I have a Report with a subreport, and I want to assign a value to the control source of a control on the subreport depending on the value given by the user in a separate form. Based on advice from the online help and from other posts in this group, I wrote the following code which is called on the On Open even of the main report. I have tried several variations on this, which always result in the same error message-
1
4895
by: Marie | last post by:
How do you display a total from a subreport on the main report. If it makes a difference, the total is a total of a calculated field (Qty * Price). Does the total on the subreport go in the pagefooter or report footer? Say the total is shown in a texrbox named MyTotal and the subreport control is named MySubreportControl, what exactly do I put in the control source of a textbox on the main report to show the total? Thanks For All Help! ...
1
2211
by: Frank | last post by:
I am trying to manipulate a textbox display value of subreport from main report's detail print() event. The goal is this, if there is no record from database, replace the blank space from textbox with message " No record found ". I found the exact expression to reference my subreport textbox value from main report, but when I tried to use IsNull() and Nz() function to distinguish between blank and non-blank value, surprising it did not...
1
3775
by: shaqattack1992-newsgroups | last post by:
I know this is kind of a weird question, but is there anyway to give a subreport control of a main report? I posted my situation earlier about having drawings print out after a group. I have a report grouped by part group that lists the part numbers needed from that group. I have force new page after each group. This gives me a list of parts on each page. I want to print the needed drawings after the groups/list of parts. There are...
2
2367
by: Jimmy | last post by:
On the subreport, records are grouped by WorkDate. In the WorkDate header there is a textbox named DateCounter with the control source =1 and running sum set to yes. In either the report footer or the WorkDate footer (I tried both with no difference) is a textbox called DateCount, the control source of which is =DateCounter. If this subreport is run as a seperate report, DateCounter shows 1...2...3...etc for each seperate WorkDate and...
6
2931
by: xian2 | last post by:
Hi All, I know you have heard this all before from the millions of other people asking the same question, but I have read through many other posts and NeoPa's guide and another guide i found on the internet (http://allenbrowne.com/casu-18.html) but to no avail. Some background info: frmTours Contains 2 subforms (on seperate tabs), one to select the desire Tour Days and the other to select the Additional Costs. rptInvoice
12
8030
D Giles
by: D Giles | last post by:
Access 2003: A subreport control (sum total calculated textbox located in the subreport report footer) does not show total of all records when referenced as a total in the main report footer - only shows one record amount. When I open the subreport alone, it totals the sum of all the records which the query pulls - which is what I want. The referenced textbox in the main report footer only shows one record amount. Why is the total in the main...
0
9522
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9223
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8233
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4588
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4860
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.