Hello, sure glad to find this forum, I have been pulling my hair out trying to figure how to limit the number of records returned in the detail section of a grouped report.
I have a report that has three grouping,
.Track
..Surface
...Distance
Then the actual records are sorted by descending date. This is where I want to limit the records to say the last 12. I can not filter on date because the last twelve could have happened anytime.
I can not figure how to do it, please help.
This is what I tried so far.
I did a little research online and came across a forum that suggested the following
-adding an invisible count box named counter, setting the control source property to =1 and setting the running sum box to across groups.
This added a running count to the detail sections, it resets to zero at every new group.
- then on Format event adding this code
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [Counter] >12 Then Cancel = True
End Sub
I get the count but the report still lists all records. I have never used VBA in the past, maybe I am missing something obvious. Hoping someone guides me in the right direction.
Thank you in Advance