Microsoft KB Archive/123712

= ACC: How to Determine Which Snaking Column Is Current =

Article ID: 123712

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q123712



Novice: Requires knowledge of the user interface on single-user computers.



SUMMARY
This article describes how to determine which snaking column in a report is current. This determination is useful for:


 * Setting columns so that each has an equal number of items.
 * Drawing separation lines between the columns.



MORE INFORMATION
You can determine which column is current by checking the report's Left property. In a report with snaking columns, the Left property value is always greater in the second column than in the first column. For example, assume a report with the following dimensions:

  Left margin: 1 inch Right margin: 1 inch Report width: 3.5 Inch Column spacing: 0 Items across: 2

In the first column, the report's Left property is 1 inch. In the second column, the report's Left property is 4.5 inches (left margin + report width = second column Left property). Note that values in the Left property are measured in twips. One inch contains 1440 twips.

You can determine if the second column is current without knowing the report's dimensions by comparing the value of the Left property with the width of the report. If the value of the Left property is greater than the width of the report, the second column is current. Note that this method works only if you click the Same As Detail check box in the Page Setup dialog box (or Print Setup in version 2.0). To verify the Same As Detail option setting, open the report in Design view, and then:

In Microsoft Access 97:

On the File menu, click Page Setup, and then click the Columns tab.

In Microsoft Access 7.0:

On the File menu, click Page Setup, and then click the Layout tab.

In Microsoft Access 2.0:

On the File menu, click Print Setup, and then click the More button.

You can use this information in conjunction with the report's OnFormat property to perform a variety of tasks, such as ensuring that each column has an equal number of items, and drawing lines between the columns.

NOTE: For an example of using the Left property, please see the Sales Averages report in the Developer Solutions database, Solutions.mdb (or Solution.mdb in version 2.0), included with Microsoft Access. The Sales Averages report is a multiple column report that prints the labels in the first left-most column of the report. The data prints in the columns after the labels. For a code example, see the ShippedDate Header OnFormat event procedure in Design view of the Sales Averages report.

