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

Counting records in a report

Status
Not open for further replies.

Eltoque

Technical User
Jan 12, 2002
21
US
I have a basic report and it has several columns. It has one "status" column based on a list.
I am trying to get a report to count the number of each status type that comes up within the report (i.e. Completed = 5, In Process = 3, etc. It is important that it only takes what is the report since the report can be significantly different depending on the criteria entered to open it. I cannot seem to get DCount or Count to work right for me.
Could someone please help?
 
There must be a neater way, but I have got around this in the past by doing a summary query based on the query your report is driven from, and using this to drive a subreport. As I say, not pretty but it works...

Nigel
 
Assuming your fields are string, under the Options Explicit establish an integer variable for each possible response

dim x as integer, y as integer, etc

In the detail section:

Select case response
case 1
x = x + 1
case 2
y = y + 1
ect...
End Select

Place the results in unbound text boxes.

mac
 
Is a query the record source for your report?? If so, you should be able to use the DCount function, specifying the query as the domain, not the table.
 
Thank you. Based on all your suggestions I was able to get past the mental block I was having and finally made it work.
This is THE best source for help I have ever found on ANY topic!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top