Adding additional lines to fill a page

N

Nelson

I have a form with a header, 1 group header, detail and a
footer. The detail section can have up to 6 records
displayed. When the group has less than 6 records, I need
to print additional blank records to fill the page with
the formated boxes and lines. In other words, if the
record source query has two records, the form needs to add
4 more detail lines with blank text boxes. If the query
has 5 records, the form needs to add an additional line.

Any ideas? TIA
 
D

Duane Hookom

This is some sample code in the On Page event of a report that draws the
lines. You should remove all line controls and allow the code to create
them.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin 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.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)-Step(Me.Width,
0)
Next
End Sub
 
G

Guest

Thanks Duane, That did the trick!
-----Original Message-----
This is some sample code in the On Page event of a report that draws the
lines. You should remove all line controls and allow the code to create
them.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin 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.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)-Step(Me.Width,
0)
Next
End Sub

--
Duane Hookom
MS Access MVP





.
 

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