Number of records in a Report

  • Thread starter Thread starter Hanksor
  • Start date Start date
H

Hanksor

Is it possible to only show "X" number of records in a report with out using
the top value in a query? Any help will be appreciated......
 
Open the report in design view.
In the Report Footer section (View menu if you don't see that section), add
a text box, with this control source:
=Count("*")
 
Add a control to the detail section.
Set its Name to txtLineCount
Control Source to =1
Set Running Sum to Over All

Add code to the Detail Section on Format to

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Cancel = (Me.txtLineCount > 10)
'Alternate line of code for the line above would be
'Me.PrintSection = (Me.txtLineCount <= 10
 
Back
Top