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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output to csv format 1

Status
Not open for further replies.

MoiraT

Technical User
Jun 13, 2002
150
GB
Hi
Can anyone tell me please how I can output a text file in .csv format from Access 2002 using VBA? I need to create this file to import into Sage accounts which has to be in csv format and I don't want the user to have the job of running a further conversion on the file. This is what I have so far, which creates the file but not in csv format.

stDocName = "qTickedforSage"
stFileDate = Format(Date, "dd.mm.yyyy")
stPath = "S:\job&invoice database\"
stFilename = stPath & "InvoicesForSage" & stFileDate
DoCmd.OutputTo acOutputQuery, stDocName, acFormatTXT, stFilename

Any help appreciated.
Moira
 
Thanks. I started looking at this after the post. I thought it might be helpful to others doing this to know the code I used as I had trouble with it until putting .csv as part of the file name. This is my code:

' Transfer tbInvoicesToSage to a .csv file
stFileDate = Format(Date, "dd.mm.yyyy")
stPath = "S:\job&invoice database\"
stFilename = stPath & "SageInvoices" & stFileDate & ".csv"
DoCmd.TransferText acExportDelim, "SageInvoices Export Specification", "tbInvoicesToSage", stFilename, True, ""
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top