Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting Printed Records 1

Status
Not open for further replies.

hpicken

Technical User
Apr 12, 2001
142
AU
I have a report that is being printed from a filtered continuous form. I'm using

DoCmd.OpenReport "rptNameList", acViewPreview, , ssql

to open this report where ssql is a SQL string that has built up from the form's sql filter.

I want to limit the number of records that this report prints to 100.

Is there a way within the report itself to stop getting anymore detail records once 100 is reached and print what's there? Or will I have create a query based on the form's filter to do this?

TIA
Howard
 
You can add a text box to the detail section of the report:
Name: txtRecCount
Control Source: =1
Running Sum: Over All
Visible: No

Then add code to the On Format event of the detail section:
Cancel = Me.txtRecCount>100

Duane
MS Access MVP
 
Yep it's well thanks again Duane

Howard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top