Recordset help needed

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Have a recordset which produces a list of invoices
between Data A and Date B. One of the fields in that
recordset has the invoice value.

How would I be able to get a value/calculate for the the
sum of that field?

Thanks in advance

Richard
 
I not sure if I fully understand your problem because
recordset might mean several things. If you are using
DAO/ADO and you declare a Recordset and can Movenext,
Movefirst then just go through the recordset and keep
adding your invoices to a variable:

Do Until rs.eof
variable = variable + rs!FieldName
loop

If you are not using a true Recordset then in code you can
try the DSum. This is the esample copied from the Help
files:
Dim curX As Currency
curX = DSum ("[Orders]!
[Freight] ", "[Orders]", "[ShipCountry] = 'UK'")

-Cameron Sutherland
 
Back
Top