Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfer Text 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

I am running this code to export a table. it works fine but I want it to also bring out the headers as the first row of the csv file.
I cannot find a way to do it, as anyone and ideas please. Thanks

Sub ExportContacts()
DoCmd.TransferText acExportDelim, "ContactsNew Export", _
"Contacts", "I:\Trex\Database 2013\ContactsNew.csv"
End Sub
 

Add "True" for column headers:

Code:
Sub ExportContacts()
DoCmd.TransferText acExportDelim, "ContactsNew Export", _
"Contacts", "I:\Trex\Database 2013\ContactsNew.csv", True
End Sub

Thanks
Michael
 
In the IDE, if you highlight TransferText in your code and press F1, you will see the help file entry for the command, which tells about all the parameters for the command, including why adding True solves your problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top