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

Blank grid lines in a report 2

Status
Not open for further replies.

bailey11

Technical User
Jan 18, 2005
103
US
I have a Sign In/Out report that fills names of active employees, but I need blank grid lines going to the bottom of the page regardless of the number of records.

I have five columns:
Name, company,Signature,Time in, Time Out. The last 3 columns are always blank.

How do I draw lines both horizontal and vertical to the end of the page? There should be a total of 35 lines per page under the header. I can get the horizontals, but don't know how to draw the verticals.

Thanks in advance!!!!
 
Here is some code to draw all the horizontal lines. You could add a few lines of code to use the Line method to draw vertical lines.

Code:
Private Sub Report_Page()
    Dim intNumLines As Integer
    Dim intLineNum As Integer
    Dim intDetailHeight As Integer
    Dim intPageHeadHeight As Integer
   On Error GoTo Report_Page_Error

    intNumLines = 35
    intDetailHeight = Me.Section(acDetail).Height
    intPageHeadHeight = Me.Section(3).Height
    For intLineNum = 1 To intNumLines
        Me.CurrentY = (intLineNum - 1) * intDetailHeight + intPageHeadHeight
        Me.CurrentX = 0
        Me.FontBold = True
        Me.FontSize = 14
        Me.Print intLineNum  'print the line number
        Me.Line (0, intPageHeadHeight + intLineNum * intDetailHeight)- _
            Step(Me.Width, 0)
    Next

   On Error GoTo 0
   Exit Sub

Report_Page_Error:
    Select Case Err
        Case 2462  'no page header
            intPageHeadHeight = 0
            Resume Next
    End Select
    MsgBox "Error " & Err.Number & " (" & Err.Description & _
        ") in procedure Report_Page of VBA Document Report_Report1"
    
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]
 
It is the verticals I don't know how to draw. I am fairly new to code so I don't know how to use the line method.
 
Code to draw a vertical line as the same X coordinate but different Y values like:
Code:
   intLeft = 1440 '1" in
   intTop = 720   '.5" from top
   intLineBottom = 14400 '10" line
   Me.Line (intLeft, intTop)- _
       (intLeft, intLineBottom)



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