ACC: Report Vertical Lines Don't Grow with Section

Last reviewed: October 24, 1997
Article ID: Q151543
The information in this article applies to:
  • Microsoft Access versions 7.0, 97

SYMPTOMS

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

Vertical Line controls don't increase in height when placed in a report section whose CanGrow property is set to Yes.

NOTE: This article explains a technique demonstrated in the sample files, RptSampl.exe (for Microsoft Access for Windows 95 version 7.0) and RptSmp97.exe (for Microsoft Access 97). For information about how to obtain these sample files, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q145777
   TITLE     : ACC95: Microsoft Access Sample Reports Available on MSL

   ARTICLE-ID: Q175072
   TITLE     : ACC97: Microsoft Access 97 Sample Reports Available on MSL

RESOLUTION

You can use the Line method to prevent unbroken lines even if the report section grows. The following example uses the sample database Northwind.mdb to demonstrate how to use the Line method.

  1. Open the sample database Northwind.mdb.

  2. Create a new report based on the Employees table using the AutoReport: Columnar Wizard.

  3. Set the report's OnOpen property to the following event procedure:

          Private Sub Report_Open(Cancel as Integer)
    
             DoCmd.Maximize
          End Sub
    
    

  4. Set the report's OnClose property to the following event procedure:

          Private Sub Report_Close()
    
             DoCmd.Restore
          End Sub
    
    

  5. Set the report's OnPage property to the following event procedure:

          Private Sub Report_Page()
    
             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)    ' Draws line at Left
                                                          ' Margin.
             Me.Line (1 * 1440, 0) - (1 * 1440, 14400)    ' Draws line at 1
                                                          ' inch.
             Me.Line (1.9 * 1440, 0) - (1.9 * 1440, 14400)' Draws line at 2 in.
             Me.Line (5.5 * 1440, 0) - (5.5 * 1440, 14400)' Draws line at 3 in.
    
             ' The 14400 is an arbitrary number to increase the line to the max
             ' of a section.
          End Sub
    
    

  6. Set the detail section's OnPrint property 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
    
    
Print Preview the report. Note that the lines go from the top to the bottom of the page.

REFERENCES

For more information about the Circle Method, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q116501
   TITLE     : ACC: How to use the Circle Method on a Report

For more information about the Line method, search on the phrase "Line method" using the Microsoft Access 97 Help Index.
Keywords          : FmrProb kbusage
Version           : 7.0 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb
Solution Type     : kbcode


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.