Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print outline of table on report

Status
Not open for further replies.

basbrian

Programmer
Feb 18, 2002
49
AU
I am trying to print the following
print a page header then print the detail lines and then a page footer. if there are only 2 detail lines I still need to print 3 lines with the "column" lines before the footer prints. I have put the column lines between the fields in the detail line, then added another footer with just the column lines in it. however I can not work how to print this footer from a loop I have put in the page footer.
________________
ph1 | ph2| ph3
________________
d1 | e2 | f1
d2 | e2 | f2
d3 | e3 | f3
d4 | e4 | f4
__d5__|_e5_|_f5___
footer1

if this makes sense, please help. Willing to try any thing.
using xp and office 2000, not a regular user of access and vba
 
I remove all borders from controls and use the Line method in the On Page event of the report. This code draws borders around all controls in the detail section and duplicates this 15 times.
Code:
Private Sub Report_Page()
    Dim intNumLines As Integer
    Dim intLineNumber As Integer
    Dim intTopMargin As Integer
    Dim ctl As Control
    Dim intLineHeight As Integer
    ' draw 15 copies of the boxes
    intNumLines = 15
    intTopMargin = Me.Section(3).Height
    intLineHeight = Me.Section(0).Height
    For Each ctl In Me.Section(0).Controls
        For intLineNumber = 0 To intNumLines - 1
            Me.Line (ctl.Left, intTopMargin + _
                (intLineNumber * intLineHeight)) _
                -Step(ctl.Width, intLineHeight), , B
        Next
    Next
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
thanks, but this makes a grid. I am after verticle lines between the fields that will be the same length on each page
 
You can modify the code to draw just vertical lines rather than boxes. Try change one line to:
Code:
    -Step(0, intLineHeight), , B

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top