I have been working with the below code for a few days but havent been able to reach my desired results. The code forces horizontal lines, but wont put it in the detail section on print preview, only the page header.
I would like to force ten rows in the details section every time the report runs, even with zero records. I'd like the text box's format to show, meaning all the gridlines like that of an excel file to be intact.
In addition, i would be using a query to gather the information, and would like to force stop on the 10th record and continue a new page before adding additional records from the same id.
Any suggestions?
test1 is how the access report is displaying now.
test2 is how i would like the report to actually print.
I would like to force ten rows in the details section every time the report runs, even with zero records. I'd like the text box's format to show, meaning all the gridlines like that of an excel file to be intact.
In addition, i would be using a query to gather the information, and would like to force stop on the 10th record and continue a new page before adding additional records from the same id.
Any suggestions?
test1 is how the access report is displaying now.
test2 is how i would like the report to actually print.
Code:
Option Compare Database
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 = 10
intLineLeft = 350 '1/2 inch from left margin
intLineWidth = 1440 * 7.5 '5 inches
intTopMargin = Me.Section(0).Height 'details
intLineHeight = Me.Section(0).Height
Me.FontSize = 10
For intLineNumber = 0 To intNumLines - 1
Me.CurrentX = intLineLeft
Me.CurrentY = intTopMargin + _
(intLineNumber * intLineHeight)
Me.Print intLineNumber + 1
Me.Line (intLineLeft, intTopMargin + _
(intLineNumber * intLineHeight)) _
-Step(intLineWidth, 0)
Next
End Sub