Programming Export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I apologize for posting this question to another board. I posted to the
Import/Export board 2 days ago and got not response. I probably should have
posted here first.

*****

I thought I had done this before in another database. I'm trying to export a
query "ExportFinal" using specifications "ExportSpecifications" to a file
with the date such as f:\RBNPS\Export\NPS092607.txt I keep getting an
invalid path error.

Dim stExpName As String
Dim stSpecs As String
Dim stExport As String


stExpName = "f:\RBNPS\Export\NPS" & Format(Date, "mmddyy") & ".txt"
stSpecs = "ExportSpecification"
stExport = "ExportFinal"

DoCmd.TransferText , stSpecs, stExport, stExpName
 
You have not specified the first argument of the TransferText. That means
that ACCESS will assume you want the default value, which is acImporDelim --
meaning that you're telling ACCESS you want to import a file, not export it.
You need to specify the first argument in the DoCmd.TransferText call so
that it tells ACCESS what you want to do.
 
PERFECT! Thank you so much!

Ken Snell (MVP) said:
You have not specified the first argument of the TransferText. That means
that ACCESS will assume you want the default value, which is acImporDelim --
meaning that you're telling ACCESS you want to import a file, not export it.
You need to specify the first argument in the DoCmd.TransferText call so
that it tells ACCESS what you want to do.
 
Back
Top