I didn't think this would be such a big deal but gosh...
I have a very simple form based off of 4 fields from a table and 1 calculated field:
Field 1 (text) = ProductName
Field 2 (double) = UnitCount
Field 3 (double) = BuildingCount
Field 4 (memo) = Notes
Field 5 (calcualted) = calcProductType: DLookUp("[ProductType]","[List-ProductTypes]","[ProductName] = [Forms]![HOA-Associations-Subform-Products]![Product]")
So far so good. This correctly pulls the ProductType for the ProductName field shown in the table. The only values possible for ProductType are "SF" and "MF".
Now, all I want to do is have a few subtotals in the footer of my form. I want to sum all of UnitCount so long as calcProductType="SF" (for my total SF UnitCount). To do this I created the following formula:
=Sum(IIf([calcProductType]="SF",[UnitCount],0))
That's when I get an error. It just doesn't want to work. Instead of a calculated field within my query I tried putting the DLookup formula in an unbound field within the form but that produced no different results.
So what's the deal? Can I not sum values with criteria being a calculated value? Any help would be much appreciated.
Take care.
I have a very simple form based off of 4 fields from a table and 1 calculated field:
Field 1 (text) = ProductName
Field 2 (double) = UnitCount
Field 3 (double) = BuildingCount
Field 4 (memo) = Notes
Field 5 (calcualted) = calcProductType: DLookUp("[ProductType]","[List-ProductTypes]","[ProductName] = [Forms]![HOA-Associations-Subform-Products]![Product]")
So far so good. This correctly pulls the ProductType for the ProductName field shown in the table. The only values possible for ProductType are "SF" and "MF".
Now, all I want to do is have a few subtotals in the footer of my form. I want to sum all of UnitCount so long as calcProductType="SF" (for my total SF UnitCount). To do this I created the following formula:
=Sum(IIf([calcProductType]="SF",[UnitCount],0))
That's when I get an error. It just doesn't want to work. Instead of a calculated field within my query I tried putting the DLookup formula in an unbound field within the form but that produced no different results.
So what's the deal? Can I not sum values with criteria being a calculated value? Any help would be much appreciated.
Take care.