By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Count, Sum or Ave records in a table with VBA

P: n/a
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)

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You seem to answer your own question.

What is it you want to achieve in the end? I can hardly imagine you want
to have some sum, or average, or table :-) in memory for as long as your
code runs. But not longer.

Maybe you really want to create a report?

Tempy wrote:
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)

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.