Transfering fsub subtotals to frm Totals

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form frmOrders (based on a tblOrders) and a subform
fsubOrderDetails (based on a query QryFrmOrderDetails). In the fsub form I
have an textbox (SubTotal) that is formed in the query that contains an
equation for multiplying the unit cost by quanitity and taking off a
percentage.

I want a text box to appear on my main form that displays the sum of all of
the subtotals from the fsubOrderDetails.

How can I do this??
 
Open the Northwind sample database that installs with Access.

Open the Orders form. There is an example there, where the Orders form shows
the total of all the line items from the subform.

It is definately worth pursuing that example until you understand how it
works. And BTW, you must not store the total in the main form's table. Do it
the way the Northwind example does.
 
You could use a two-step process:

First, in the subform, add a Footer control that is the sum of all the
values -- note that you won't be able to refer to a calculated control.
You'll have to do the calculations again in the footer control, something
like:
=Sum(... whatever calculation you do in your [SubTotal] control
again here ...)

Second, in the main form, add a control that "points" to the subform's new
footer control, something like:

=Forms!YourMainForm!YourSubformControlName.Form!YourNewFooterControlInSubfor
m

Naturally, you'll need to use your actual form and control names (your
syntax may vary!).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 

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

Back
Top