Microsoft KB Archive/286247

From BetaArchive Wiki
Knowledge Base


Vertical lines in a report do not increase in height in a report section

Article ID: 286247

Article Last Modified on 10/26/2004



APPLIES TO

  • Microsoft Access 2002 Standard Edition



This article was previously published under Q286247

Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

For a Microsoft Access 2000 version of this article, see 208429.


SYMPTOMS

Vertical line controls do not increase in height when you put them in a report section. This problem occurs even if you set the CanGrow property for the section to Yes.

This article explains a technique that is demonstrated in the sample file that is named RptSmp00.mdb.

For additional information about how to obtain this sample file, click the following article number to view the article in the Microsoft Knowledge Base:

231851 The "Access 2000 sample: report topics” database available in Download Center


RESOLUTION

Use the Line method to prevent broken lines if the report section grows. The following example uses the sample database that is named Northwind.mdb to demonstrate how to use the Line method.

  1. Open the sample database that is named Northwind.mdb.
  2. In the Database window, click Reports, and then click New.
  3. In the New Report dialog box, click AutoReport: Columnar. in the Choose the table or query where the object's data comes from box, click Employees, and then click OK.
  4. Set the OnOpen property of the report to the following event procedure:

    Private Sub Report_Open(Cancel as Integer)
       DoCmd.Maximize
    End Sub
                        
  5. Set the OnClose property of the report to the following event procedure:

    Private Sub Report_Close()
        DoCmd.Restore
    End Sub
                        
  6. Set the OnPrint property of the detail section to the following event procedure:

    Private Sub Detail_Print(Cancel as Integer, PrintCount as Integer)
        Me.ScaleMode = 1
        Me.ForeColor = 0
    
        'Repeat the following line of code for each vertical line.
        '1 * 1440 represents 1 inch.
        Me.Line (0 * 1440, 0) - (0 * 1440, 14400)
        Me.Line (1 * 1440, 0) - (1 * 1440, 14400)
        Me.Line (1.9 * 1440, 0) - (1.9 * 1440, 14400)
        Me.Line (5.5 * 1440, 0) - (5.5 * 1440, 14400)
    
        'The 14400 is an arbitrary number to increase the line
        'to the max of a section.
    End Sub
                        

Preview the report. Notice that the lines run from the top to the bottom of the page.

REFERENCES

For more information about the Line method, click Microsoft Visual Basic Help on the Help menu, type line method in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.



Additional query words: prb

Keywords: kbtshoot kbdta kbprb KB286247