A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Form with SubForm Totals



 
 
Thread Tools Display Modes
  #1  
Old February 1st, 2010, 03:36 PM posted to microsoft.public.access.forms
iamnu
external usenet poster
 
Posts: 99
Default Form with SubForm Totals

In the Subform Query Builder, I have the following field:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [AcctID])))

AcctID is on the MainForm.

I have tried the following expressions with no success:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [Forms]![MedicalForm]![AcctID])))
AND
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[Forms]!
[MedicalForm]![AcctID] = " & [Forms]![MedicalForm]![AcctID])))

In other words, I want to show the total BillPayAmt for each AcctID.

Can someone show me what I'm doing wrong?
  #2  
Old February 1st, 2010, 03:45 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Form with SubForm Totals

Much simpler than that. First add a footer to your subform. Now if your
subform is in continuous form view, you are ready to go.

Set the controlsource of a textbox in the footer to:

= Sum([BillPayAmt])

For a datasheet, you'll need to add a textbox to the main form, and set it's
controlsource to read the subform textbox:

= Forms!YourFormName!YourSubformControlName.Form!Tex tboxName
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"iamnu" wrote in message
...
In the Subform Query Builder, I have the following field:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [AcctID])))

AcctID is on the MainForm.

I have tried the following expressions with no success:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [Forms]![MedicalForm]![AcctID])))
AND
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[Forms]!
[MedicalForm]![AcctID] = " & [Forms]![MedicalForm]![AcctID])))

In other words, I want to show the total BillPayAmt for each AcctID.

Can someone show me what I'm doing wrong?



  #3  
Old February 1st, 2010, 04:25 PM posted to microsoft.public.access.forms
iamnu
external usenet poster
 
Posts: 99
Default Form with SubForm Totals

On Feb 1, 8:45*am, "Arvin Meyer [MVP]" wrote:
Much simpler than that. First add a footer to your subform. Now if your
subform is in continuous form view, you are ready to go.

Set the controlsource of a textbox in the footer to:

= Sum([BillPayAmt])

For a datasheet, you'll need to add a textbox to the main form, and set it's
controlsource to read the subform textbox:

= Forms!YourFormName!YourSubformControlName.Form!Tex tboxName
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com

"iamnu" wrote in message

...

In the Subform Query Builder, I have the following field:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [AcctID])))


AcctID is on the MainForm.


I have tried the following expressions with no success:
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[AcctID] = "
& [Forms]![MedicalForm]![AcctID])))
AND
AcctTotal: CCur(Nz(DSum("[BillPayAmt]","[tblPayDetail]","[Forms]!
[MedicalForm]![AcctID] = " & [Forms]![MedicalForm]![AcctID])))


In other words, I want to show the total BillPayAmt for each AcctID.


Can someone show me what I'm doing wrong?


Thanks for the reply, Arvin.
I already have those totals on my Subform. But what I want to do is
to get sums from BillPayAmt that belong to the AcctID, then another
for those that belong to the PayerID and another for those that belong
to the DrID.

On the MainForm, I want to see "Grand Totals" for each Acct, each
Payer, and each Dr.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.