Here’s what I’m trying to do. I have a table full of items called T_Equipment. Sometimes, an item will be a combination of several items in T_Equipment (e.g. a motor + a base plate + some screws, etc). I have a table called T_MakeUps that has this information.
T_Equipment has (among other things) a field called “ModelNumber”
T_MakeUp has only two fields: “ParentNumber” and “ItemsWithinParent”. The data in both fields come from T_Equipment.
The idea is that I have all items in one lovely table. A legacy system at a previous gig had different lists for stand alone items, and for these “make ups” and it was a royal mess.
I’ve build a form for T_Equipment, and a subform for T_MakeUps. All is well.
What I’m trying to do next is add up all the Suggested List Prices and Costs…kind of important. I’ve turned to my trusty DSUM Function, and I’m stuck as to the criteria statement at the end.
Dim F As Form
Set F = Me
Dim TempList As Single
TempList = DSum("E_ListPrice", "T_Equipment", "??"
In English, my criteria is:
Sum up the E_ListPrices of all the items in T_Equipment where the item appears in T_MakeUp in the “ItemsWithinParent” field and the item in “ParentNumber” Matches the particular record I’m working with in this form. (And that particular record is F!ModelNumber).