ability to limit records printed to 5 on a sub report (within areport)

R

RMC

I have a report that pulls up equiopment info. Within this report,
there is a subreport that pulls up all maintenance info for that piece
of equipment. There may be up to 100+ records, though I only want to
print 5.

The sub report on the main report it linked by the master and child
field. (The sub report query does not have a parameter field to limit
the records)

I've lopked at the TOP SQL Function, though it doesn't work with what
I want.

Basically, just need to have the detail section nof the sub report
print 5 of the first records and that is it?

Does anyone have any ideas on how to get the subreport to only print
the 5 records?

Any info would be appreciated,

RMc
 
D

Duane Hookom

You can add a text box to the detail section of the subreport:
Name: txtCount
Control Source: =1
Running Sum: Over Group
Visible: No
Then add code to the On Format event (module window) of this section:
Cancel = (Me.txtCount>5)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top