Export to File with Current Date

G

Guest

I'm trying to export a file with the current date and keep getting the
following error. "The Microsoft Jet database engine could not find the
object 'NPS100907.txt'. Make sure the object exists and that you spell its
name and the path name correctly." I could have swore this worked, but maybe
I already had a file with the aftorementioned name. Code below. Any help
would be greatly apprecieated.



Private Sub ExportFile_Click()

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


stExpName = "f:\RB_NPS\WolpoffExport\NPS" & Format(Date, "mmddyy") & ".txt"
stSpecs = "WolpoffExportSpecification"
stExport = "WolpoffExportFinal"

DoCmd.TransferText acExportDelim, stSpecs, stExport, stExpName

MsgBox ("Export Complete File Name is f:\RB_NPS\WolpoffExport\NPS" &
Format(Date, "mmddyy") & ".txt")

DoCmd.SetWarnings False
Dim stDateQry As String
stDateQry = "WolpoffExport_ChangeDate"
DoCmd.OpenQuery stDateQry, acViewNormal
DoCmd.SetWarnings True

End Sub
 
K

Ken Snell \(MVP\)

Do you have full access rights to the folder "f:\RB_NPS\WolpoffExport\" ?

Are you sure that the export specification matches the query being exported?
Same number of fields, names of fields, data types, etc.?
 
G

Guest

How embarrasing, I thought it was working Friday. Changed a field name.
Works find now! Thanks a bunch!!!
 

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