Top N Report in Access??

  • Thread starter Thread starter DJ
  • Start date Start date
D

DJ

I have a reort that is grouped and ranked perfectly. Is
there a way to do a TopN report in Access after grouping?
I want to see only the top 4 records for each group. Can
this be done?
Thanks!
 
You can add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over Group
Then add code to the On Format event of the detail section
Cancel = Me.txtCount > 4
 
THANKS Duane!! Worked like a charm!
-----Original Message-----
You can add a text box to the detail section:
Name: txtCount
Control Source: =1
Running Sum: Over Group
Then add code to the On Format event of the detail section
Cancel = Me.txtCount > 4

--
Duane Hookom
MS Access MVP





.
 
Duane Hookom said:
Then add code to the On Format event of the detail section
Cancel = Me.txtCount > 4
^^^^^^
Is this "Cancel" a property or variable ? I tried it using various
syntax like

=Cancel=Me.txtCount > 4
Cancel=Me.txtCount > 4
=[Cancel]=(Me.txtCount > 4)

And so on ... but it does like either.
Please help.
 
Are you entering this in a code/module window?

--
Duane Hookom
MS Access MVP


Shashank Date said:
Duane Hookom said:
Then add code to the On Format event of the detail section
Cancel = Me.txtCount > 4
^^^^^^
Is this "Cancel" a property or variable ? I tried it using various
syntax like

=Cancel=Me.txtCount > 4
Cancel=Me.txtCount > 4
=[Cancel]=(Me.txtCount > 4)

And so on ... but it does like either.
Please help.
 
Back
Top