Link to home
Start Free TrialLog in
Avatar of Dustin Stanley
Dustin Stanley

asked on

MS Access DoCmd.TransferText acExportDelim But For Creating New Files Not Existing Files.

I am familiar with using DoCmd.TransferText acExportDelim for exporting and writing over a EXISTING CSV file in a folder but what would I use to write a new file if it was not there?  

If Dir("C:\DailyExport\NewExport.CSV") <> "" Then
DoCmd.TransferText acExportDelim, "ExportToComExportSpecification2", "ComExportNewTemp", "C:\DailyExport\NewExport.CSV", True
   Else
    ' put code here to elicit a new file name or you can add a number on to the name
End If
    

Open in new window


Thanks for the help.
ASKER CERTIFIED SOLUTION
Avatar of bfuchs
bfuchs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dustin Stanley
Dustin Stanley

ASKER

It didn't seem right to me either but there must had been some underlying issue that worked out. It was giving me an error but now it just creates it fine. Boggling but it works now. Thanks for the help.