ACC: How to Create a Line That Can Shrink and Grow in a ReportLast reviewed: July 16, 1997Article ID: Q170838 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. The detail section of a report can grow and shrink vertically if you set its CanGrow and CanShrink properties to Yes. However, line controls do not have these properties and cannot grow or shrink as the detail section does. This article demonstrates how to use the Line method to draw a line that can grow and shrink as the detail section does. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual. NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access version 2.0. For more information about Access Basic, please refer to the "Building Applications" manual.
MORE INFORMATIONThe Line method accepts two sets of coordinates. The first set (X1,Y1) determines the top left position, which is the starting point of the line. The second set (X2,Y2) determines the bottom right position, which is the end point of the line. The X1 and X2 arguments for a vertical line always have the same value, because these arguments specify how far from the left margin the line is printed. However, the values of the Y1 and Y2 arguments of a vertical line differ, and that difference specifies the height of the line. Because a report's detail section can grow or shrink to varying sizes, you can set the Y2 argument to a value that is greater than the expected maximum height of the detail section. Thus, the line is never shorter than the height of the detail section. NOTE: Microsoft Access has a limitation of 22 inches for the height of a control or section. You will receive an overflow error if you try to set the Y2 argument to a value greater than 22 inches. If your detail section grows in excess of 22 inches, Microsoft Access will not be able to draw the line for the remainder of the section. The following steps demonstrate how to use the Line method to programmatically draw a line in a report's detail section and make it the same height as the section.
REFERENCESFor more information about using the Line method in reports, search the Help Index for "Line method." For more information about using the Line method to draw rectangles, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q124642 TITLE : ACC: How to Shrink and Grow a Rectangle in a Report |
Keywords : kbcode PgmHowTo RptLayou
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |