code for saving a table into a text file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone show me how to write the code to save a table into a text file?

Thanks!
 
Try TransferText.

Example:
DoCmd.TransferText acExportDelim,, "Table1", "C:\Table1.txt", True

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
I tried it, and it worked.
However, the values become enclosed in quotation marks when they are saved.
How do I avoid these quotation marks?

Thanks!
 
When using TransferText you have various options. In the first parameter you
can select to export to html instead for example. Read the help topic.
(Place cursor on TransferText and press F1)
 
I know this thread is long dead, but to anyone reading it currently:

To get rid of any delimiters ("s or ';' or others) and just get
tab-delimited, use
DoCmd.TransferText acExportDelim, "",
"table_name","file_path_to_be_stored",False,""

The first pair of empty quotes is the parameter for delimiter and entering
"" seems to default to tabs - at least for me it does!
 

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

Back
Top