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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complete report in page header? 1

Status
Not open for further replies.

mcollins

Programmer
Jun 16, 1999
27
0
0
US
I am trying to create a 'sign-in sheet' report. It needs to have the people's names printed on each row. The sign-in sheet has 15 rows, but there may be only 3-4 people to be listed for a given report.

I want the sign-in sheet to print all 15 sign-in rows, even if there are less people than that.

I have done other single page reports like this (but not in Access) by doing the whole report in the page header band, and looping through the data and putting the data where I want it.

Is this possible in Access 2000? Can I get to the report recordset, or do I need to create a new one?

Mike
 
I would draw lines using the Line Method in the On Page event of the report. This code draws 24 lines.
Code:
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

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 Duane, this approach works great. I just have to put in the vertical lines, but I guess I can do that in the Detail Band.

Mike
 
If the lines stretch mostly from top to bottom, I would do them in the On Page event also. I have code in a report (at home) that uses the Line and Print methods of the report to draw a calendar of the current month with the dates numbered.

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 Duane. I did them in the On Page event and it worked great also.

The only thing is that I was not able to get the line thickness quite what I wanted. I put a

Code:
Me.DrawWidth = 2

in the On Page handler code (and even tried 3) but it seemed to barely have any effect.

Mike
 
Oh I see I was comparing pixels and points. If I use 6 pixel DrawWidth it looks just right.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top