Access VBA Macro Programming

(Joao Candeias) #1
The syntax is:

DoCmd.TransferText
(TransferType,SpecificationName,TableName,FileName,HasFieldNames,

HTMLTableName,CodePage)


The arguments are all optional:

 TransferType This is an acTextTransferType constant and is generally acImportDelim,
acImportFixed, acExportDelim, or acExportFixed. The default is acImportDelim. This
defines whether the fields are deliminated by a comma(,) or are fixed width, and whether
you are importing or exporting to the text file.
 SpecificationName This is the name of the specification you saved when you did
your “dry run.” It contains extra information such as which fields to include, how to
treat dates, and what the deliminator character is.
 TableName The name of the table to import/export to. If you are exporting, you can
also put a query name here.
 FileName The full name, including the path of the text file you are importing/
exporting to.
 HasFieldNames True or False as to whether the first row of import has field names.
The default is false.
 HTMLTableName A string that is the name of a table or list in an HTML file that
you are importing/exporting to. This is only used for HTML files.
 CodePage A long value giving the character set of the code page.

Chapter 16: The DoCmd Object 219

Free download pdf