Microsoft Knowledge Base Email Alertz

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 only the labels in the first column and only the text boxes in

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 208491 - Last Review: June 23, 2005 - Revision: 3.0

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

This article was previously published under Q208491
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SUMMARY

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 only the labels in the first column and only the text boxes in subsequent columns.

MORE INFORMATION

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

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Open the sample database Northwind.mdb, and then create a new, blank report based on the Employees table.
  2. If it is not displayed, open the Field List box, and then add the FirstName, LastName, and Title fields to the Detail section of the report.
  3. Disassociate the labels from the text box controls. To do so, follow these steps:
    1. Select each label.
    2. Click Cut on the Edit menu.
    3. Select the report's Detail section.
    4. 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 then move them to the far-left side of the Detail section.
  7. Set the report's Width property to 2".
  8. On the File menu, click Page Setup.
  9. In the Page Setup dialog box, click the Columns tab.
  10. Under Number of Columns, type 3.
  11. Click the Margins tab, and under Margins (inches) set Left to .5".
  12. Click the Page tab, and then under Orientation, click Landscape.
  13. Click the Columns tab, and then under Column Size, set Width to 2".
  14. Click OK to exit Page Setup.
  15. Set the report's Detail section's OnFormat property to the following event procedure:
    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
    					
  16. On the View menu, click Print Preview.

    Note that the labels appear in the leftmost column, while the data appears in the columns to the right of the first column.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbhowto KB208491
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate