Hello,
I created and saved a new specification to output a table to text which can be viewed inside the Saved Exports tab but the VBA returns an error message saying the text file specification "kkk" does not exist. Can you please help?
I only changed the name of the "file specification" as the below code has been working for years however I can manually use the Specification.
Private Sub EXPORT_Click()
DoCmd.SetWarnings False
DoCmd.Hourglass True
Dim db As Database
Dim rs As Recordset
Dim qdf As String
qdf = DLookup("GLcount", "1f2_Admin_Exp_Table_StatsTot")
Set db = CurrentDb
DoCmd.OpenQuery "1f6a_check_req_tbl_DELETE", acViewNormal, acEdit
DoCmd.OpenQuery "1f6c_check_req_append_MD", acViewNormal, acEdit
DoCmd.TransferText acExport, "Export-tblCk_Requests", "tblCk_Reqs", "S:\Finance\Accounting Operations\National Accounts\Consortium Pricing\PAR\nasco_ap_ck_md.txt", False, ""
DoCmd.OpenQuery "QdelTblCK_regsAll", acViewNormal, acEdit
DoCmd.OpenQuery "QappTblCK_regsAllmd", acViewNormal, acEdit
DoCmd.OpenQuery "1f6a_check_req_tbl_DELETE", acViewNormal, acEdit
DoCmd.OpenQuery "1f6b_check_req_append_DC", acViewNormal, acEdit
DoCmd.TransferText acExport, "Export-tblCk_Requests", "tblCk_Reqs", "S:\Finance\Accounting Operations\National Accounts\Consortium Pricing\PAR\nasco_ap_ck_dc.txt", False, ""
DoCmd.OpenQuery "QappTblCK_regsAlldc", acViewNormal, acEdit
DoCmd.Hourglass False
MsgBox "The MD and DC files have been copied to the S drive, please verify the totals and copy them to the R drive!!"
DoCmd.SetWarnings True
End Sub
Thanks,
Bob