Hi,
I have a form embedded within my current form that allows multiple records and uses the table DCPOut. Each record has a qty and I am trying to get a total of the values for each record to appear in the Totals field of the current form (Me.totals). The current form has a field with an ID (Me.ID), this ID is also assigned to each record on tblDCPOut so where there are multiple records, they will share the same ID although they are of course assigned primary keys using another field in the DB.
Dim totalQty As Long
totalQty = DSum("qty", "tblDCPOut", "ID=" & Me.ID)
Me.totals = totalQty
In the case of the current ID there are 2 records on tblDCPOut but only 1 is being picked up and I cannot see why this is.
Please excuse my novice questions!
Any help is appreciated