Printing empty lines in report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created a report that looks like a standard form used by my company to
order equipment. The standard form, however, has empty visible lines (like
Excel) to the end of the page if the records does not fill it up. is it
possible to print lines in a report that does not contain data? (in order to
make it look like the original Excel document)
 
You can use the Line method in the On Page event of your report. You should
be able to modify the following code to meet your needs. The code draws
rectangles around the detail section and up to 24 more even if they are not
24 records.

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
Me.FontSize = 16
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, intDetailHeight), , B
Next
End Sub
 
This works nicely. I have 3 more questions though with which I need some help:
The lines does not show when I use the report as a subreport,
There is a number in the beginning of each line and
no lines are drawn vertically between fields.

Thank You.
 
1) there is no On Page event run for subreports. You would need to use the
code in the main report only.
2) comment out the line the prints the number
'Me.Print intLoop + 1
3) the code doesn't draw vertical lines between fields. You would need to
figure out how to do this based on the code provided.
 
Back
Top