423,851 Members | 2,680 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,851 IT Pros & Developers. It's quick & easy.

form/subform and calculated control

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
Thanks a ton Allen.

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

Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.