rproactive
Technical User
Hi- Could use some help with the subform Sum(IIF()) blues. I want to sum the values in a subform for only certain values.
I would like to sum the values on subform bound to [SchedRecurringCategoryAmt]
iif the category name [SchedRecurringCategoryName] is 56.
I have tried the following 3 variations:
thanks for any suggestions
Code:
My subform is bound to table M_SchedRecurring
My mainform is bound to table M_ReceiptSlip
My subform control is named subFS_SchedREcurringCONTROL
Source Object: FS_SchedRecurring
Link Child: SchedRecurringLeases_IDs
in table M_SchedRecurring
Link Master: ReceiptSlipLeases_IDs
in table M_ReceiptSlip
[SchedRecurringCategoryAmt] & [SchedRecurringCategoryName] are fields in table M_SchedRecurring
[cboSchedRecurringCategoryName] is control on subform that displays the [SchedRecurringCategoryName]
I would like to sum the values on subform bound to [SchedRecurringCategoryAmt]
iif the category name [SchedRecurringCategoryName] is 56.
I have tried the following 3 variations:
Code:
=Sum(IIf([b]56[/b]=56,SchedRecurringCategoryAmt],0))
works , but 56=56 isn’t the condition I want
=Sum(IIf([b][cboSchedRecurringCategoryName][/b]=56,[SchedRecurringCategoryAmt],0)) #ERROR
=Sum(IIf([b][SchedRecurringCategoryName][/b]=56,[SchedRecurringCategoryAmt],0)) #ERROR
=Sum(IIf([b]”SchedRecurringCategoryName”[/b]=56,[SchedRecurringCategoryAmt],0)) #ERROR
thanks for any suggestions