How sum a value directly from the table where equal to a subform c

  • Thread starter Thread starter ldiaz
  • Start date Start date
L

ldiaz

Hello all.'

I would like to have this in an before event.

Dim StrProducedQty as string

I don't know how get this sum...
StrProducedQty = sum [Produced_Qty] from table [tbl_WOProduced] where
[tbl_WOProduced] is equal to this control on the subform (Work_OrderN)

Note: These are my forms and subform names.
FormName: frm_Production_Report
SubformName: sfrm_WOProduced

If StrProducedQty + me.Produced_Qty > WOQty Then
MsgBox "Qty exceed the valance of the WO, type a lower value than the
valance", vbCritical, "Qty exceeded"
Cancel = True
End If
 
On Wed, 6 May 2009 19:22:07 -0700, ldiaz

You can get the sum using the DSum function - see help file.

-Tom.
Microsoft Access MVP
 
that does not work if I want to eliminate extra fields on the subform..

I want a string

--
Lorenzo Díaz
Cad Technician


Tom van Stiphout said:
On Wed, 6 May 2009 19:22:07 -0700, ldiaz

You can get the sum using the DSum function - see help file.

-Tom.
Microsoft Access MVP

Hello all.'

I would like to have this in an before event.

Dim StrProducedQty as string

I don't know how get this sum...
StrProducedQty = sum [Produced_Qty] from table [tbl_WOProduced] where
[tbl_WOProduced] is equal to this control on the subform (Work_OrderN)

Note: These are my forms and subform names.
FormName: frm_Production_Report
SubformName: sfrm_WOProduced

If StrProducedQty + me.Produced_Qty > WOQty Then
MsgBox "Qty exceed the valance of the WO, type a lower value than the
valance", vbCritical, "Qty exceeded"
Cancel = True
End If
 
Back
Top