Link to home
Start Free TrialLog in
Avatar of tcalbaz
tcalbazFlag for United States of America

asked on

Capturing the text from DoCmd.Output in MS Access

Hi all,
I hope someone can help me with this one.  We are trying to get rid of extra line feeds that are appearing in the text output of our microsoft access reports.  The command being used is:
DoCmd.OutputTo acOutputReport, reportName, acFormatTXT, printFileName, False, "", varEncoding

We've tried many methods to rid ourselves of the extra line spaces such as setting the Can Grow, Can Shrink options to TRUE for Report Sections and for text fields.  And we've tried widening the fields to make the vertical space smaller but so far, no luck.

We've also considered saving the output to the hard drive as a text file and then just running a filter to eliminate the extra line feeds but that would add precious seconds to each transaction of thousands and so therefore this is unacceptable.

So far it looks like we have to find a solution within the actual report or within the application.

Has anyone else had some success with this kind of issue?
Thank you

Ted
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

It's probably got to do with the way Access formats these reports for the acFormatTXT format ... not sure what can be done, other than to play around with this until you hit upon the right combination.

You could output directly to a Text file, if that would be more suitable. Access/VBA provides quite a few methods to write directly to Text files, if that would suit you better.
ASKER CERTIFIED SOLUTION
Avatar of rheitzman
rheitzman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tcalbaz

ASKER

Guys, thanks for your help.  rheitzman and boag2000 both provided solid approaches to resolving the problem.  rheitzman your last response about writing directly to a text file though it wasn't utilized because of server timing considerations offered a possible new way of resolving things in the future.  

Regards,

Ted