Calculate SUM in field on main FORM from SUBFORM with criteria???

haris

Registered User.
Local time
Today, 09:37
Joined
Feb 12, 2002
Messages
13
Hello!
I have one problem! I have FORM and SUBFORM in that form with REFERENTIAL INTEGRITY. I have few fields in subform in datashet view! I SUBFORM I have field Amount and field Type! I have three choices on field Type and same same kind of values in Amount field! I would like calculate SUM in one field in MAIN FORM from Amount specified by criteria in field Type. I tried put for one criteria in one field in main form =DSum("[frmSub].[Form]![txtAmount]";"[frmSub].Form.RecordsetClone";"[frmSub].[Form]![txtType]='INVEST'"), but I always get an ERROR Massage in that field! I will be gratefull for answer!
Greetings from Sarajevo,
Haris
 
Do the calculation in the subform footer. ie.
=Sum(Iif([Type]="Whatever",[Amount],0))
In the main form just set a text box to =[SubformName]![SummedControlName] Change the names to suit.
HTH
 

Users who are viewing this thread

Back
Top Bottom