473,883 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form/subform and calculated control

I have a "form" and "subform" where I would like a calculated control
on the form which sums the values of a datasheet column of the subform.
(datasheet on subform may have a variable number of entries)

I can't seem to get the calculated control on main form to do what I
want......

Is this possible, if so, how?

Help!

Nov 13 '05 #1
6 5891
Open the Northwind sample database.
Open the Orders form.
See how the SubTotal control picks up the value from the control in the
subform's Footer section.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@dauber t.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I have a "form" and "subform" where I would like a calculated control
on the form which sums the values of a datasheet column of the subform.
(datasheet on subform may have a variable number of entries)

I can't seem to get the calculated control on main form to do what I
want......

Nov 13 '05 #2
I checked the NW example out and used the exact syntax they did (with
my control names).

Control just shows "#Error".

The subform control I'm trying to sum is a calculated control
itself.......is this causing the problem? If so, is there a way around
it?
Doug

Nov 13 '05 #3
If you placed the control in the Form Footer section of the subform, and
checked that it worked (by opening the subform itself in Form or Continous
view), then the issue must be with the way you referred to the control in
the subform. For help with that, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@dauber t.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
I checked the NW example out and used the exact syntax they did (with
my control names).

Control just shows "#Error".

The subform control I'm trying to sum is a calculated control
itself.......is this causing the problem? If so, is there a way around
it?

Nov 13 '05 #4
Actually, I had already moved the control from the main form to the
footer section of the subform in question.

It shows "#Error".

Again, can I sum a control which is itself a calculated control????
Doug

Nov 13 '05 #5
There are 2 ways to do that:

a) Repeat the calculation in the control source of the form foorter. For
example, if you have a text box with a Control Source of:
=[Quantity] * [PriceEach]
in the Form Footer you could use:
=Sum([Quantity] * [PriceEach])

b) Put the calculated field in a query, so that it is a field in the form's
RecordSource. You can then sum it. (This is what the Northwind example
does.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<dh*****@dauber t.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Actually, I had already moved the control from the main form to the
footer section of the subform in question.

It shows "#Error".

Again, can I sum a control which is itself a calculated control????
Doug

Nov 13 '05 #6
Thanks a ton Allen.

I finally got it to work via method b).
Doug

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8318
by: chris vettese | last post by:
I've been having trouble with this for a long time. I have a form that has many subforms. In the subforms I have unbound text boxes in the footer that sum a field. I want to Display this sum on the main form for each subform and then add them all together. In a book I have it gives the following example: =(Object type!!.Form!) I created an unbound text box on my main form and filled in the information in the example above and get a...
2
1820
by: Tony Williams | last post by:
I have a form with a tabcontrol which has a number of pages. I want to check the value of a calculated control on one page with a calculated control on another page. The calculated control (txtTotNbrClients) on page 3 is the sum of these controls on that page ( + + + + + + + ) The calculated control on page 4 (txtClientsTot) is the sum of these controls on that page ( + + + +
2
1999
by: Bruce | last post by:
Hi, I have 3 nested forms and wish to calculate a value on Subform 1 by adding 2 values on the same subform + to a value in a control on the footer of the underlying subform . I use this as the recordsource for my total =.Form!Sumpd++) which works well except when there are no records in the transactiontbl subform - I get an error.
5
1860
by: Ron | last post by:
Hi All, I've got a form called frmCust that has a subform on it called sfrmBalance. sfrmBalance's control source is a query called qryTrans4CustBal. sfrmBalance has one field on it called fldTransTotal where the control source is =Sum(). LineTotal is derived from Quantity * Amount in the above query. I have a checkbox called chkActive on frmCust that I want to allow the operators to uncheck only if the balance of the customer is...
2
5548
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by Form" in order to search for records based on this form, I would like to be able to enter a value in this "days" control so that I can filter records on the form based on this calculated interval (i.e., i want to search for records specifically where...
4
1696
by: Michael R | last post by:
In a continous form, I need txbControl1 to be conditioned according to txbControl2. txbControl1 control source is: =DSum("Amount","Loans","Id=Forms!Cities!Customers.Form!Id") txbControl2 control source is of the subform's record source table So the condtional formatting of txbControl2 would be: txbControl1.value = 1000
2
3087
by: PrimeHawk | last post by:
I am attempting to add a calculated control that counts the number of records displayed in a subform. I have two seprate tabs, hopefully it will not change the value if I switch between the tabs. I have tried the following codes to no avail: =MemberInformationSubform.Form!txtFirstNameCount and Count* Hoping that it would count the first name field entries that I have entered.
17
18384
by: MariaTorvalds | last post by:
I have a problem where if I use a calculated control, for example =Date()) on my form, PLUS I have a subform on a tab control on the same form, then when I refresh the record (by menu command or VBA me.refresh), the DB crashes! I've stripped the thing right down, and tested with a) no calculated control - no problem, b) no subform - no problem. c) moving the subform off the tab control to a free space on the underlying form - again, the...
29
2953
by: Bigdaddrock | last post by:
I have tried using the SetValue Macro to assign the value of a calculated control to another BOUND Control on the same form but have not been successful. I followed the exact format shown in MS Access help instructions. The amount appears properly in the unbound text box (derived from data in a subform within the same form), however I cannot get that amount to then appear in a Bound Control's text box using the SetValue macro. I am only...
0
9940
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11142
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...
1
10847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10415
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...
1
7971
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
7128
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
5797
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...
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3232
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.