Exporting report as text file and getting unwanted blank spaces

G

Guest

When I export an access report to a text file, I get a blank space between
each field. This is resulting in the data in my text file being offset. For
example, I have a numeric field which needs to fill 8 columns and an alpha
field which needs to fill 8 columns of a text file. The alpha column needs
to start at column 9 (it just does not look that way in the example).
12345 abc
12345678xyz
When I export the report as a text file, I get an extra blank space, which
offsets my alpha field, as in the example below.
12345 abc
12345678 xyz
I am using a report (as opposed to exporting the query) because I need the
layout of the report - my example is far more simplified than the actual data
I am working with.
 
G

Guest

Reports are not well suited to export to a text file. It is more work, but I
believe you would have more success if you write the code to create the text
file manually.

A less intensive alternative might be to use a query. I know you need the
layout, but with a little creativity, it might be possible to get the format.
For example, if you need field 2 to start in column 9 and column 1 is
numeric, you can format the numeric field like this:

NumField: Space(8-Len(Format([SomeNum],"########0"))) &
Format([SomeNum],"########0")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top