DSum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good day.

I am trying to and populate a field in the main form "TTLCostCND" by
summing a field in a subform"CostFT. I get the error message Argument not
optional. Any help would be appreciated to achieve this goal

Mainform is called "frmQuotes" - Table is called tblQoutes
Subform is called "frmQuotesSubform" - Table is called tblQuotesSubfrm

Private Sub UOM_AfterUpdate()
Me.CostFT = Round(Me.CCRATE * Me.HRSCft / 100, 4)
Me.Form_frmQuotes!TTLCostCND = DSum(Me.CostFT)

End Sub

Thanks in advance.
 
What you are calling a field is a control. It only contains one value, so it
can't be summed. The DSum is a domain aggragate function, meaning it is used
with tables or queries to sum a field.
 
I mam trying to sum the control called [CostFT] in a subform called
"FrmQuotesSubform" and then display the Sum of [CostFT] in a control called
TTLCOSTCND on the form that hosts the subform called frmQuotes.

I can sum the control [CostFT] in the subform footer but I want this value
poplulated in the TTLCostCND control
 
Back
Top