Grand Total on the main form

  • Thread starter injanib via AccessMonster.com
  • Start date
I

injanib via AccessMonster.com

My form has a subform. One of the field in the subform is "txtTotal". The
control Source of this filed is a field called "Total" in the table. There is
an unbound field in the footer of the subform that adds the "Total" field of
the Table with the following in the Control Source.

=sum([Total])

I have made this field "not visible", because I don't want it to appear on
the subform. Instead, I have another field called "txtGrandTotal" on the main
form that I want to display the grand total.
I have made the control source of the "txtGrandTotal" field as follows.

=form!subFormControSource!ControlSource

The problem I have is that I need this field to feed the grand total into a
field called "GrandTotal" in my table. I originally had this filed as the
control souce of my "txtGrandTotal" field of my form, but I could not get the
grand total to show from my subform on my main form.
I tried the "After update", "On dirty", "On change" properties of the field
on the subform to place the data in my "txtGrandTotal" on the main form, but
none of them worked.
I used the following code for that.
me.parent!txtGrandTotal=me.ControlNameOnTheSubform

I hope I did not make this very confusing.
 
P

Piet Linden

My form has a subform. One of the field in the subform is "txtTotal". The
control Source of this filed is a field called "Total" in the table. There is
an unbound field in the footer of the subform that adds the "Total" fieldof
the Table with the following in the Control Source.

=sum([Total])

I have made this field "not visible", because I don't want it to appear on
the subform. Instead, I have another field called "txtGrandTotal" on the main
form that I want to display the grand total.
I have made the control source of the "txtGrandTotal" field as follows.

=form!subFormControSource!ControlSource

The problem I have is that I need this field to feed the grand total intoa
field called "GrandTotal" in my table. I originally had this filed as the
control souce of my "txtGrandTotal" field of my form, but I could not getthe
grand total to show from my subform on my main form.
I tried the "After update", "On dirty", "On change" properties of the field
on the subform to place the data in my "txtGrandTotal" on the main form, but
none of them worked.
I used the following code for that.
me.parent!txtGrandTotal=me.ControlNameOnTheSubform

I hope I did not make this very confusing.

Any reason an update query won't work?
 
P

Piet Linden

And why are you storing calculated values anyway? You should be
calculating them on the fly...
 
I

injanib via AccessMonster.com

None that I can think of.
It does not give me an error message.

Piet said:
My form has a subform. One of the field in the subform is "txtTotal". The
control Source of this filed is a field called "Total" in the table. There is
[quoted text clipped - 24 lines]
Any reason an update query won't work?
 
I

injanib via AccessMonster.com

I am not sure what you mean by calculating them on the fly, but my table has
a form "GrandTotal" whose value is then used on other forms too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top