I don't know how MS suggests you make the lines. The solution I use is to
draw the lines with code in the On Page event of the report. This code draws
24 lines regardless of the number of records on the page.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
Dim intDetailHeight As Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub

Signature
Duane Hookom
MS Access MVP
>I am using code provided by Microsoft on how to print a constant number of
> lines on a report. I use it for forms where the printed form has to have x
[quoted text clipped - 17 lines]
> are printed. I've tried everything I can think of to avoid this behavior
> without success. Can anyone help me?
DataLady - 28 Oct 2005 15:56 GMT
Duane: Here are the functions (modified for my needs) that are being used in
the OnPrint event of the Group Header and Detail sections respectively. I was
able to use the code you supplied successfully, except that I had to modify
the top margin value to make the lines start printing lower on the page, as
there is a page header and a group header section that shouldn't have the
lines. As long as I have something that works, I'm happy, except that I have
several applications where I need the ability to control the number of lines
within sections of a report and it would be nice if the functions below could
be make to work reliably without duplicating the last record when the total
count of the records is equal to the TotGrp value.
Public Function SetCount(R As Report)
TotCount = 0
R![Destination].Visible = True
R![EventDate].Visible = True
R![PickUpTime].Visible = True
R![DropOffTime].Visible = True
R![NumStudents].Visible = True
R![NumBuses].Visible = True
End Function
Public Function PrintLines(R As Report, TotGrp)
TotCount = TotCount + 1
If TotCount = TotGrp Then
R.NextRecord = False
ElseIf TotCount > TotGrp And TotCount < 14 Then
R.NextRecord = False
R![Destination].Visible = False
R![EventDate].Visible = False
R![PickUpTime].Visible = False
R![DropOffTime].Visible = False
R![NumStudents].Visible = False
R![NumBuses].Visible = False
End If
End Function

Signature
Sue A
> I don't know how MS suggests you make the lines. The solution I use is to
> draw the lines with code in the On Page event of the report. This code draws
[quoted text clipped - 37 lines]
> > are printed. I've tried everything I can think of to avoid this behavior
> > without success. Can anyone help me?
Duane Hookom - 28 Oct 2005 20:30 GMT
I don't care to reverse engineer their code. I would just use the code that
I know works.

Signature
Duane Hookom
MS Access MVP
--
> Duane: Here are the functions (modified for my needs) that are being used
> in
[quoted text clipped - 88 lines]
>> > behavior
>> > without success. Can anyone help me?