Microsoft Knowledge Base Email Alertz

(199055) - If you output the data in a report, the only controls that are included in the output file are text boxes (for .xls output files), or text boxes and labels (for .rtf, .txt, and .html output files). All other controls are ignored. This article show you...

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: 199055 - Last Review: June 30, 2004 - Revision: 2.0

ACC2000: How to Output Horizontal Lines on Report Using OutputTo

This article was previously published under Q199055
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

If you output the data in a report, the only controls that are included in the output file are text boxes (for .xls output files), or text boxes and labels (for .rtf, .txt, and .html output files). All other controls are ignored.

This article show you how you can use the String() function to output horizontal lines in your report.

MORE INFORMATION

The String() function returns the number of characters that you specify for the string. To output lines in a report by using the MyOutputTo() function, use the String() function as follows:

  1. Open the report to which you want to add the lines in Design view.
  2. Create an unbound text box, and place it on the report in the position where you want to have the line appear. Widen the text box to the length you would like the line to be.

    NOTE: Delete the label portion of the text box if you do not want it to appear in the report.
  3. In the ControlSource property of the text box, type the following
    =String(<number>, <character>)
    where <number> is the length of the string and <character> is the repeating character string that you are using.

    For example, to print a total of 125 dashes (-) across a report, type the following in the ControlSource property:
    =String(125,"-")
  4. Switch the report to Preview to make sure the line appears where you want it.
  5. Close and save the report.
  6. Create a module and type the following procedure:
    Sub MyOutPutTo()
    
       DoCmd.OutputTo acOutputReport, "<ReportName>, acFormatTXT, _
             "C:\<OutputFileName>"
    
    End Sub
    						
    NOTE: For <ReportName>, substitute the name of your report, and for <OutPutFileName>, substitute the name for your output file.
  7. Run the procedure from the Immediate window. Note that the report is output with the lines.

APPLIES TO
  • Microsoft Access 2000 Standard Edition
Keywords: 
kbhowto kbprint kbprogramming KB199055
       

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

Julio Reported as Irrelevant  
Written: 7/27/2004 10:24 AM
Untill now, to make the lines visibles on my reports I make a preview of the report to a full size and make a capture screen, saved after as "jpg" image for importing to a Word document and printing. I know this is not the "fine" way, but anyway, in most cases, my reports are not to be edited, so I don't care and the trick works.