# Thread: print grid to bottom on report

1. Registered User
Join Date
Jan 2004
Posts
75

## Unanswered: print grid to bottom on report

Bear with me on this one, please... My understanding of VB is scatterbrained on the best of days (self-taught, yikes!).

I learned from this forum, MVPS, & Lebans (thanks to all) how to print(draw, whatever) lines on a report to my own specifications. Using a little bit of luck and copied code, I am able to print horizontal lines all the way to the bottom of my report, creating blank lines after all records. I now need to print 41 vertical lines at even intervals starting about 2.75in from the left margin. For the life of me, I can't seem to make it work.

This is the pitiful little bit of code I have right now that creates 12(??) vertical lines at random intervals across the report. The vertical starting and ending points are what I want. This is added with the horizontal line code in the Report_Page section.

Dim p, num As Integer
p = 3.685
For num = 0 To 41
p = p + .280
Me.Line ((1070 * (p * num)), (1070 * 0.7))-((1070 * (p * num)), 10580)
Next

Bottom line: I need a report in a very specific format (preexisting non-Access form) that lists the client names down the left side of the report with a grid to the right. And before anyone asks, I need the blank lines to the bottom of the page to allow write-ins on the report. This is a non-flexible need.

Any help would be greatly appreciated!! Thanks in advance.

2. Registered User
Join Date
Jan 2004
Posts
75
I swear.... I love when this happens.... stress for forever and as soon as I ask I figure it out... go figure.

turns out it's my algebra that needs help, not my code....

for curious parties, this did the trick:

'draw vertical lines
Dim p, num As Integer
'this is how many lines I need
For num = 0 To 41
'set the spacing between lines by growing p, initial p should be starting point from left margin
p = 3.685
p = p + (num * 0.28)
'this draws the line
Me.Line ((1070 * p), (1070 * 0.7))-((1070 * p), 10580)
Next

3. Registered User
Join Date
Feb 2004
Location
Chicago, IL
Posts
1,312
Are the line positions (ex. starting at 2", 4" etc.) always the same? Are the lengths always the same? If so I have always used subreports.

Start by making your Main Report. Make the Detail Section as large as it can be (based on margins, footers, and headers). Then when you have the dimensions, make a subreport. The sub report's Detail section can be as large as the Main Report's Detail Section. The only thing you add to the subreport is the gridlines. In your case only vertical, but horizontal if it works for you. Then add the subreport to the main report. Set the subreport so that it cannot grow.

As for the data, create a second subreport that will print the data. Allow this one to grow, and put it on top of the first subreport. If the two subreports have transparent backs then the data should show as well as the lines.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•