473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 5865
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*****@daubert.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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*****@daubert.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.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*****@daubert.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.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
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...
2
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...
2
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...
5
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...
2
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...
4
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...
2
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...
17
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...
29
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.