Count/Sum or Ave all rows of a field

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

Hi all, i am a newbie to this game and want to know if it is possible
with VBA to count up all the rows for a specific field for a table or
average or sum ?
If it is possible, could you help me with some code please.

I add up fields succesfully with the following :-

myLcPo = Nz(DSum("[Total LC PO's]", _
"tblTotalLcPO's", "[ByrName] = ""Kufner"""), 0) + Nz(DSum("[Total LC
PO's]", "tblTotalLcPO's", "[ByrName] = ""Steyn"""), 0)
 
Les

No code needed. Open a new query in design mode, add the field(s), select
the "Totals" query (toolbar button). Use "Sum" to aggregate.
 

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

Back
Top