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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count with no queries 1

Status
Not open for further replies.

Tejanorey

Technical User
Mar 23, 2002
219
US
Is there a way to count records on a report without having any querys established. The database that I have has its all of its reports 'feeding' of the table (no queries created). Tejanorey

"Do not attack the First Marine Division. Leave the yellowlegs alone. Strike the American Army."
- Orders given to Communist troops in the Korean War; shortly afterward, the Marines were ordered to not wear their khaki leggings to keep the enemy from immediately fleeing
 
Hi,
You can use the DCount function to return record counts from a database, all without having to create a query.
Here is a sample, given that the table name is tblExample:

This code should be placed in the Control Source for a new text box added to the report.
=DCount("[fldExample]", "tblExample")

If you want to count all the records for a specific customer, you would set up the function as follows:
=DCount("[Customer_id]", "tblOrders", "[Customer_id] = '1234'") 'this presumes that Customer_id is string HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top