Programming Export

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
 
K

Ken Snell \(MVP\)

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top