Whing Dela Cruz
asked on
sum of a field
Hi experts, Is it possible to get the sum of a certain fields during Insert execution? Please see my code below where I tried to get the sum of a credit but the codes is not working. Any help please!
Public Sub SaveSalesPOS(rct, record, disc, tot, edate, cid, credit, check, cuscode)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
cn.Execute ("Insert into CustomersLedger(CustomersCode,iDate,TransactionNumber,Credit,Debit,Balance) Values('" & cuscode & "','" & _
edate & "','" & record & "'," & credit & "," & "0" & "," & Sum(SalesPerTrx.credit) & " where CustomersCode='" & cuscode & "')")
Set rs = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER