Wadero
02-23-2004, 11:20 AM
I am working on 2 column report/subreport. The rows in the subreport are autonumbered with a running sum over group. I am looking for a way to find the total number of records in each subreport in the On Open (or other) Event.
I tried Me.CurrentRecord but I get an error because it appears that value is null upon opening the subreport. I tried inserting the code into On Activate but it never gets there.
Any help would be appreciated.
=Count(*) in the subReport footer
Wadero
02-23-2004, 01:08 PM
I don't want to actually display that value, rather I want to be able to use it in an event procedure. I would like to resize the subreport footer based on the number of records in that subreport. You ask why?
Maybe there is a better way than what I am thinking... this is a 2 column report, with 4 subreports per column. Each subreport can contain anywhere from 1 to 10 records but I want all of the subreports to be 2.5" in height regardless so the headers line up evenly across each column.
What I originally wanted to do was to use an event to resize the report footer based on the number of records...
Me.ReportFooter.Height = 2880 - RecordsPerReport * 288
I had already tried to use Count(*) in the On Open event but VBA does not allow that expression.
Basically if there are 10 records, there is no footer. If there is only 1 record, the footer would be 1.8" to create blank space between that record and the next subreport header.
Looking for a solution or for a better way to do this?
Thanks
This may help
Article ID: Q119073
Wadero
02-24-2004, 12:13 AM
Thanks, looks like what I need. I tried out the example and it worked. Now I just have to incorporate it into my report. Shouldn't be a problem.