The code produces an error because Access doesn't see the table: tmp_Results
If I then open the database windows and press {F5} tmp_Results will show.
Is there another way to get Access to see the new table on the sql server?
Code:
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "usp_CreateLoad_tmpResults_Table"
cmd.CommandTimeout = 0
cmd.CommandType = adCmdStoredProc
cmd.Execute
Set cmd = Nothing
CurrentData.AllTables.Application.RefreshDatabaseWindow
DoEvents
DoCmd.TransferText acExportDelim, , "tmp_Results", ResultsFilePath, True