ACC: How to Show Labels in Only the First Column of a Report

Last reviewed: July 11, 1997
Article ID: Q148397
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0

SUMMARY

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

Microsoft Access repeats both text boxes and labels in the detail section when you set up a report to print multiple columns. This article describes a method that you can use to print just the labels in the first column and just the text boxes in subsequent columns.

MORE INFORMATION

The following steps show how to create a three-column report with labels in only the first column, using the Employees table in the sample database Northwind.mdb:

  1. Open the sample database Northwind.mdb (or NWIND.MDB in version 2.0), and create a new, blank report based on the Employees table.

  2. If it is not displayed, open the Field List box, and add the FirstName, LastName, and Title fields to the detail section of the report.

    NOTE: In version 2.0, there is a space in the First Name and Last Name fields.

  3. Disassociate the labels from the text box controls. To do so, follow these steps:

    a. Select each label.

    b. Click Cut on the Edit menu.

    c. Select the report's detail section.

    d. Click Paste on the Edit menu.

  4. Rename the label controls to [FirstNameLabel], [LastNameLabel], and [TitleLabel].

  5. Place each of the labels directly on top of its corresponding text box control.

  6. Select all of the controls in the detail section and move them to the far-left side of the detail section.

  7. Set the report's Width property to 2".

  8. In Microsoft Access 7.0, on the File menu, click Page Setup. In Microsoft Access 2.0, on the File menu, click Print Setup.

  9. In Microsoft Access 7.0, in the Page Setup dialog box, click the Layout tab. In Microsoft Access 2.0, in the Print Setup dialog box, click More.

  10. Under Items Across, enter 3.

  11. In Microsoft Access 7.0, click the Margins tab, and under Margins (inches) set Left to .5". In Microsoft Access 2.0, under Margins, set Left to .5".

  12. In Microsoft Access 7.0, click the Page tab and under Orientation, click to select Landscape. In Microsoft Access 2.0, under Orientation, click to select Landscape.

  13. In Microsoft Access 7.0, click the Layout tab and under Item Size set Width to 2". In Microsoft Access 2.0, under Item size, set Width to 2".

  14. Click OK to exit from Page or Print Setup.

  15. Set the report detail section's OnFormat property to the following event procedure.

    'NOTE: In version 2.0, for the following code, type a space in [First 'Name] and [Last Name].

    If Me.Left < (2 * 1440) Then

             Me![FirstNameLabel].Visible = True
             Me![LastNameLabel].Visible = True
             Me![TitleLabel].Visible = True
             Me![FirstName].Visible = False
             Me![LastName].Visible = False
             Me![Title].Visible = False
             Me.NextRecord = False
          Else
             Me![FirstNameLabel].Visible = False
             Me![LastNameLabel].Visible = False
             Me![TitleLabel].Visible = False
             Me![FirstName].Visible = True
             Me![LastName].Visible = True
             Me![Title].Visible = True
          End If
     
    
    	
    	


Keywords : kbusage RptLayou
Version : 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbhowto


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: July 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.