Help with conversion to text format

  • Thread starter Arvin Villodres
  • Start date
A

Arvin Villodres

I'm trying to convert a table to an MD DOS Text format
my code looks like this:

DoCmd.OutputTo acTable, "tblLeaveTrans", "MS-DOSText
(*.txt)", "d:\eb.txt", False, ""

and the output looks like this:
----------------------------------
| TRANSNO | From |
| 114 | 7/7/2003 |
| 115 | 7/4/2003 |
| 116 | 7/5/2003 |
| 117 | 7/3/2003 |

How can I remove the heading and the lines and make my
output look like this:

114000772003
115000742003
116000752003
117000732003

Thanks for the help. I would really appreciate your help.
..
 
J

John Nurick

Hi Arvin,

What do you plan to do when TRANSNO hits 1000 and the date hits
7/10/2003?

Anyway, the thing to do is
1) create a query that uses a calculated field to return the data
formatted the way you want it. For instance, this

F1: Format([TRANSNO], "0000") & Format([From], "mmddyyyy")

will give you this:
011407072003
011507042003
011607052003
011707032003

Adjust the Format() strings as required to get the result you really
need; if necessary you can also include more zeros by sticking
& "000"
after the first Format() expression.

2) Having got this query delivering the results you want, use
DoCmd.TransferText to export it instead of DoCmd.OutputTo; that
eliminates the "ASCII art" lines and headings.



I'm trying to convert a table to an MD DOS Text format
my code looks like this:

DoCmd.OutputTo acTable, "tblLeaveTrans", "MS-DOSText
(*.txt)", "d:\eb.txt", False, ""

and the output looks like this:
----------------------------------
| TRANSNO | From |
| 114 | 7/7/2003 |
| 115 | 7/4/2003 |
| 116 | 7/5/2003 |
| 117 | 7/3/2003 |

How can I remove the heading and the lines and make my
output look like this:

114000772003
115000742003
116000752003
117000732003

Thanks for the help. I would really appreciate your help.
.

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 

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