Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!!! CountIf Function

Status
Not open for further replies.

danielles

Technical User
Mar 4, 2004
4
CA
I have a very large database, in which I am trying to do a line count, I tried to just use the 'Count' function but it generated thousands of lines. The total should be around 3300 lines in the table after this is run. This is a total PO line count, some have only 1 or 2 and others have 30 or 40 lines. I am not sure of the 'range/criteria' I should be putting in here..please help and let me know if more info is needed.

Thanks~D
 
D,

If all you need is a total count of records you could use the Dcount function.

Dcount("[Myfield]", "MyTable")

Replacing Myfield and MyTable with your field and table name will give you a count of all the records in the table.


HTH,

Steve
 
Are you doing this in a report?? If so, another way would be to put a text box in the report footer whose control source is:

[tt]=Count(*)[/tt]

Hoc nomen meum verum non est.
 
This is really confusing. Are you attempting to count unique POs or all records in the report? Using DCount(), DSum(), DLookup(), or DAnything() is usually a poor solution and should be replaced by CosmoKramer's suggestion.

If CK's suggestion doesn't work then come back with a more detailed question/requirements.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I tried a 'DCount' and I keep getting an error code, it will not let me run it. The is not a report but a query. What I have exactly is a list of subcontractors, and I am doing a financial report on all of them I have a totatl dollar spent but I want to know how many POs were issued to them, when I tried this it gave me a line per PO (and some have 30-40) so out of 3300 subcontractors this gave way too many reeults. I just want a total PO count on one line per subcontractor.

Thanks very much for the help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top