Export to CSV

wingforward

Registered User.
Local time
Today, 09:58
Joined
Nov 24, 2009
Messages
27
I'm trying to create a routine that will export query results to a csv.

This is the code I have so far, but the TransferText command isn't working.

DesktopPath() is a function returning the, surprise, Desktop Path.

Dim strQueryName As String
Dim strFileName As String
Dim strDir As String
Dim strFilePath As String
strQueryName = "qryConstantContact"
strFileName = "CC_Upload.csv"
strDir = DesktopPath()
strFilePath = strDir & strFileName

DoCmd.TransferText acExportDelim, , strQueryName, strFilePath, "True"
 
True should be a value rather than a string. Try leaving off the quote marks.
 

Users who are viewing this thread

Back
Top Bottom