Help needed, output formatting!

S

Sergei

Hi people!

need your help to fix this. I output the query resutls to
a text file and here is the part of the code

Dim strFixedIP As String

strFixedIP = "qryFixed_IP"
DoCmd.OutputTo acOutputQuery, strFixedIP,
acFormatTXT, "C:/temp/list.txt"

the result looks this:
----------------------
| Fixed_ip |
----------------------
| 0,10.88.32.1 |
----------------------
| 0,10.88.32.1 |
----------------------
| 0,10.88.32.30 |
----------------------
| 0,10.88.32.31 |
----------------------

Could you help me to get results without column headings
and no formatting, so it will look like this:

0,10.88.32.1
0,10.88.32.1
0,10.88.32.1

Thanks a lot!

Sergei
 
G

Graham Mandeno

Hi Sergei

Use the TransferText method:
Docmd.TransferText acExportDelim, , "qryFixed_IP", "C:\Temp\list.txt"

If the default format is not quite what you want then you will need to
create an import/export specification (ImExSpec). The easiest way to do
this is with the Export Text wizard (File > Export). Specify all the
options you want, then click Advanced and save the ImExSpec.

Then, specify the name of the ImExSpec as the second argument for
TransferText.
 

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