Microsoft KB Archive/151543: Difference between revisions
m (Text replacement - ">" to ">") |
m (Text replacement - """ to """) |
||
Line 140: | Line 140: | ||
[[../116501|116501]] ACC: How to use the Circle Method on a Report<br /> | [[../116501|116501]] ACC: How to use the Circle Method on a Report<br /> | ||
<br /> | <br /> | ||
For more information about the Line method, search on the phrase | For more information about the Line method, search on the phrase "Line method" using the Microsoft Access 97 Help Index. | ||
</div> | </div> |
Latest revision as of 10:10, 21 July 2020
Article ID: 151543
Article Last Modified on 1/19/2007
APPLIES TO
- Microsoft Access 95 Standard Edition
- Microsoft Access 97 Standard Edition
This article was previously published under Q151543
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
Vertical Line controls do not increase in height when you place them 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:
145777 ACC95: Microsoft Access Sample Reports Available in Download Center
175072 ACC97: Microsoft Access 97 Sample Reports Available in Download Center
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.
- Open the sample database Northwind.mdb.
- Use the AutoReport: Columnar Wizard to create a new report based on the Employees table.
Set the report's OnOpen property to the following event procedure:
Private Sub Report_Open(Cancel as Integer) DoCmd.Maximize End Sub
Set the report's OnClose property to the following event procedure:
Private Sub Report_Close() DoCmd.Restore End Sub
Set the report's OnPage property to the following event procedure:
Private Sub Report_Page() If Me.Page <> 1 then Me.ScaleMode = 1 Me.ForeColor = 0 ' Repeat the following line of code for each vertical line. ' 1 * 1440 represents 1 inch. ' Draws line at Left Margin. Me.Line (0 * 1440, 0) - (0 * 1440, 14400) ' Draws line at 1 inch. Me.Line (1 * 1440, 0) - (1 * 1440, 14400) ' Draws line at 2 in. Me.Line (1.9 * 1440, 0) - (1.9 * 1440, 14400) ' Draws line at 3 in. Me.Line (5.5 * 1440, 0) - (5.5 * 1440, 14400) End If ' The 14400 is an arbitrary number to increase the line to the max ' of a section. End Sub
If Me.Page <> 1 Then...(Line code)...End If.
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:
116501 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: kbprb kbusage KB151543