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

Sum number of records in a subreport based on criteria

Status
Not open for further replies.

Talonjpc

Programmer
Jul 29, 2002
21
0
0
US
Hi Everyone:

I have looked all over this forum but can't seem to find an answer.

I have a subreport, srptDiskStorage, and I want to count the total number of drives that are of storage type 2 on the report. The would involve counting the records for each time a storage type 2 drive appears. I have a text box on the subreport that has the storage type on it. This subreport is based on a SQL query created in the report out of two tables tblComponents and tblDiskStorage. The Query is not a premade Query, and I would prefer not to create an actual query as I want to minimize size as much a possible

Thanks alot,
Vinay
 
Suggest you do this by using a query. Add a dummy field with an iif function which writes 1 if the drive type is 2 and zero if it's not. Then use a totalling query and you'll get your answer.

You could do it in VBA using DAO, but the query would be easier and quicker.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top