C
clk
I have a database built to export the contents of a text file to the c:
\ drive. I need to have this .txt file saved with a particular name.
It must contain MineNumber!!AOIEDD_CompanyTechDate.txt
I get an error message on creation of the file name with the error of
"Object Name does not follow Microsoft Access object-naming rules".
Any help is greatly appreciated.
Here is my code:
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Set MyDb = CurrentDb()
Set rsEmail = MyDb.OpenRecordset("qryGetTextFileData", dbOpenSnapshot)
DoCmd.OpenQuery "qryCreateTableforTextFile"
DoCmd.TransferText transfertype:=acExportDelim, _
specificationname:="tblTextFileSpecs", _
tablename:="tblTextFile", _
FileName:="C:\PalmsImport\" & rsEmail!ERIMSMine & "([!!])AOIEDD_" &
Forms!frmCreateTextFile!Company & rsEmail![Last Name] _
& Format(rsEmail!dateoffile, "MDYYYY") & ".txt", _
hasfieldnames:=True
DoCmd.OpenQuery "qryDeleteTextFileData"
\ drive. I need to have this .txt file saved with a particular name.
It must contain MineNumber!!AOIEDD_CompanyTechDate.txt
I get an error message on creation of the file name with the error of
"Object Name does not follow Microsoft Access object-naming rules".
Any help is greatly appreciated.
Here is my code:
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Set MyDb = CurrentDb()
Set rsEmail = MyDb.OpenRecordset("qryGetTextFileData", dbOpenSnapshot)
DoCmd.OpenQuery "qryCreateTableforTextFile"
DoCmd.TransferText transfertype:=acExportDelim, _
specificationname:="tblTextFileSpecs", _
tablename:="tblTextFile", _
FileName:="C:\PalmsImport\" & rsEmail!ERIMSMine & "([!!])AOIEDD_" &
Forms!frmCreateTextFile!Company & rsEmail![Last Name] _
& Format(rsEmail!dateoffile, "MDYYYY") & ".txt", _
hasfieldnames:=True
DoCmd.OpenQuery "qryDeleteTextFileData"