Calculations from one form to another

L

Laura

I have 5 forms:A,B,C,D, and E. A, B, C, and D all have a calculated total. I
am trying to make form E add all of these total together. Is this possible?
 
6

'69 Camaro

Hi, Laura.
Is this possible?

Yes. In the following example, the form names are frmA, frmB, frmC, and
frmD. The text boxes holding the calculated total are named txtTotal. The
text box used to display this on frmE is txtGrandTotal.

Me!txtGrandTotal.Value = Nz(Forms!frmA!txtTotal.Value, 0) + _
Nz(Forms!frmB!txtTotal.Value, 0) + _
Nz(Forms!frmC!txtTotal.Value, 0) + _
Nz(Forms!frmD!txtTotal.Value, 0)

This code may be placed in the form's OnCurrent( ) event or wherever else
you need it. All five forms must be open at the time this code runs.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
W

Wolfgang Kais

Hello Laura.

Laura said:
I have 5 forms:A,B,C,D, and E. A, B, C, and D all have a calculated
total. I am trying to make form E add all of these total together.
Is this possible?

If all 5 forms are open: yes, in a textbox of form E us the controlsource:
=Forms!A!total + Forms!B!total + Forms!C!total + Forms!D!total
 
Top