Sum and Count on Multiple form Criteria (1 Viewer)

Iamrickdeans

Registered User.
Local time
Yesterday, 21:06
Joined
Apr 8, 2013
Messages
29
:confused:Hi All,

So again thankyou, in advance for help given in regards to this query I will simplify as much as I can on my ongoing learnign of Access so my question is this.

I have a form lets call it 'Customer' and I have a table called orders how can I write 'Excel like' Countifs and sumifs formulas? I have been trying the IIf functions I believe correctly but am not getting the results expected or rather nothing at all!

What I am wanting to do is for example look at the table 'orders' and count all 'orders' which are for the 'Customer' in the active form this field is imaginatively called 'Customer Number' and 'orders' that are for simplicity 'rocks'

Basically if the client in the active form exists in the orders field count how many times they have placed an order for rocks.

Again thank you in advance.

Regards

Richard
 

pr2-eugin

Super Moderator
Local time
Today, 05:06
Joined
Nov 30, 2011
Messages
8,494
Hello Richard,

Try DCount.. It will take in three arguments...

* The field that needs to be counted against,
* The table that it needs to look for,
* (Optional, not in your case) Criteria..

So something along the lines of..
Code:
DCount("*", "ordersTable", "customerNumber = 12345 AND productBought = 'Rock'")
 

Users who are viewing this thread

Top Bottom