Inserting empty lines into a report

J

jaworski_m

Hello,
I would like to insert empty lines to a report to make 15 lines on a page.
For example:
If there 5 records on a page, insert 10 lines to make 15 lines all together.


Thank you for suggestions.

Access 2003
Win XP
 
J

June7 via AccessMonster.com

What do you mean by 'empty' lines? If nothing is displayed what is the
purpose? Do you mean want to show a graphical line? Might be done with a
function that would build a string based on how many records in the report's
recordset. Function would be called in a textbox on the form. If number of
records results in multiple pages would want the 'empty' lines only on last
page. This could get really tricky.
 
J

jaworski_m

What do you mean by 'empty' lines? If nothing is displayed what is the

Report generated by Access should look the same as its "paper" equivalent
which always has 15 line (empty or not). Each line is numbered.
 
D

Duane Hookom

You can use the Line method in the On Page event of your report to draw all
15 lines. Your exact code would depend a little on whether you are displaying
page, report, and group header sections.

Private Sub Report_Page()
Dim intNumLines As Integer
Dim intLineNumber As Integer
Dim intTopMargin As Integer
Dim ctl As Control
Dim intLineHeight As Integer
Dim intLineLeft As Integer
Dim intLineWidth As Integer
intNumLines = 15
intLineLeft = 720 '1/2 inch from left margin
intLineWidth = 1440 * 5 '5 inches
intTopMargin = Me.Section(3).Height
intLineHeight = Me.Section(0).Height
For intLineNumber = 0 To intNumLines - 1
Me.Line (intLineLeft, intTopMargin + _
(intLineNumber * intLineHeight)) _
-Step(intLineWidth, 0)
Next
End Sub
 

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