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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a report on a preprinted form

Status
Not open for further replies.

yohad

Programmer
Feb 10, 2000
2
US
If I have 5 detail records to print on a preprinted form that has exactly 13 lines, how do I get the footer section to print the total in the correct spot? (on the &quot;14th&quot; line)<br>
<br>
Also, if there are 15 detail records to print, how do I get it to stop at 13, total and continue on the next page?<br>
<br>
I've been messing with the movelayout, nextrecord and printsection properties and can't get it to work... I've also tried the following &quot;How to Print a Constant Number of Lines Per Group&quot; article from Microsoft and it didn't work either:<br>
<br>
Option Compare Database 'Use database order for string comparisons.<br>
Option Explicit<br>
Global TotCount As Integer<br>
<br>
' Call the SetCount() function from the group header section's<br>
' OnPrint property using the syntax: =SetCount(Report)<br>
<br>
Function SetCount (R As Report)<br>
TotCount = 0<br>
R![ProductName].Visible = True<br>
End Function<br>
<br>
' Call the PrintLines() function from the detail section's OnPrint<br>
' property using the syntax: =PrintLines(Report,[TotGrp]).<br>
<br>
Function PrintLines (R As Report, TotGrp)<br>
TotCount = TotCount + 1<br>
If TotCount = TotGrp Then<br>
R.NextRecord = False<br>
ElseIf TotCount &lt;TotGrp And TotCount&gt; 15 Then<br>
R.NextRecord = False<br>
R![ProductName].Visible = False<br>
End If<br>
End Function<br>
<br>

 
I'm not sure if this will help you or not.<br>
Can you add those records to a group and then set the &quot;force new page After group&quot; option on the report.<br>
So the records you want on one page belong to one group and the others belong to another group.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top