Carrying Calculation from one form to another

G

Guest

I have successfully created a Purchase Order form that has a subform
(PurchaseOrderDetails). In the subform I have created a $ line total for
each line (LineTotal=UnitPrice*Quantity) and in the footer of the main form,
I have successfully summed the linetotals and added tax and shipping to get a
Total on the main form (just like in the Northwinds database). Now, I want
to take the field "Total" from the Purchase Order footer and insert it into a
subform on a different form - Expense Report. Thanks in advance for any
help.


S
 
J

John Vinson

I have successfully created a Purchase Order form that has a subform
(PurchaseOrderDetails). In the subform I have created a $ line total for
each line (LineTotal=UnitPrice*Quantity) and in the footer of the main form,
I have successfully summed the linetotals and added tax and shipping to get a
Total on the main form (just like in the Northwinds database). Now, I want
to take the field "Total" from the Purchase Order footer and insert it into a
subform on a different form - Expense Report. Thanks in advance for any
help.


S

Just redo the same calculation on the other form; or, put the
calculation in a Query as a calculated field and base both forms on
the Query.

John W. Vinson[MVP]
 
G

Guest

It is not the same calculation. The calculation on the Purchase Order form
is txtTotal=Sum([LineTotal]). I don't know how to use the "txtTotal" field
and make it ExpenseReportTotal=[txtTotal]+[Tax]+[Shipping]. This is the code
that I am using:
ExpenseReportTotal=[Forms]![frmPurchaseOrder]![Total]+[Forms]![frmPurchaseOrder]![Tax]+[Forms]![frmPurchaseOrder]![ShippingCharge].
It either asks me for a parameter value or when I copy the field to the
other form it shows "Name?"
 
J

John Vinson

t is not the same calculation. The calculation on the Purchase Order form
is txtTotal=Sum([LineTotal]). I don't know how to use the "txtTotal" field
and make it ExpenseReportTotal=[txtTotal]+[Tax]+[Shipping]. This is the code
that I am using:
ExpenseReportTotal=[Forms]![frmPurchaseOrder]![Total]+[Forms]![frmPurchaseOrder]![Tax]+[Forms]![frmPurchaseOrder]![ShippingCharge].
It either asks me for a parameter value or when I copy the field to the
other form it shows "Name?"

It sounds like you're assuming that a Form is a data storage
repository which can be independently used by other objects. Within
strict limitations this may be true, but in general it isn't.

Any calculation that you can do on a Form can be done in a Query. Use
a Totals Query or a query with calculated expressions. You can put the
*table fields* for Tax and ShippingCharge and Total in an expression
in a query; they don't need to be in form controls in order to add
them.


John W. Vinson[MVP]
 

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