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

Blank Rows on a report 3

Status
Not open for further replies.

AirborneBob

Technical User
Jun 24, 2007
2
US
I am taking an existing Army Form and re-creating it in a report.

When I print the report all the information shows up exactly like I want it, but if there is not enough information to to fill the page, there is a large area of blank space and then the page footer is placed at the bottom of the page.

I would like the report ot have all the blank spaces (Formated) placed in the report beneath the printed data to make the page look like to original Army DA Form.

How can I get the report to print the extra lines with the boxes in the report?

**(For any Army Personnel: It is a property book database and I am trying to automate the DA Form 2062 (Hand-Receipt). When I print the form, the required items show up on how ever many lines it takes, then a large white space and the the page footer.)

 
You might need to use the Line method to draw lines in your report in the On Page event.

This code will draw 15 sets of boxes similar in size to controls in the detail section.
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
    'Me.DrawWidth
    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
    Me.DrawWidth = 50
    Me.Line (20, 20)-(Me.ScaleWidth - 20, Me.ScaleHeight - 20), vbRed, B

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]
 
Duane

Your solution worked great. I have been trying to figure this out for a long time. Just a little tweaking with the controls on the report and it looks perfect.

Thanks

Bob
 
Hi AirboneBob,

I am currently serving in Kuwait and I was looking for this type of program. If possible can you please send me a copy of the report. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top