Recordset help needed

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
 
C

Cameron Sutherland

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top