Export to File with Current Date

  • Thread starter Thread starter Guest
  • Start date Start 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
 
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.?
 
How embarrasing, I thought it was working Friday. Changed a field name.
Works find now! Thanks a bunch!!!
 
Back
Top