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 "14th" 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 "How to Print a Constant Number of Lines Per Group" 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 <TotGrp And TotCount> 15 Then<br>
R.NextRecord = False<br>
R![ProductName].Visible = False<br>
End If<br>
End Function<br>
<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 "How to Print a Constant Number of Lines Per Group" 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 <TotGrp And TotCount> 15 Then<br>
R.NextRecord = False<br>
R![ProductName].Visible = False<br>
End If<br>
End Function<br>
<br>