Hello:
When I run this code - I am having to "zap" the contents of the table using a delete query - I want to set a parameter that will cause the transfertext command to simply overwrite the existing table simular to the way I would get prompted if I were to do it manually using the get external data file menu option - any guidance from the TeKTips Gurus would be greatly appreciated.
The code that I am using follows:
John Kolker
Programmer
jwkolker@comcast.net
When I run this code - I am having to "zap" the contents of the table using a delete query - I want to set a parameter that will cause the transfertext command to simply overwrite the existing table simular to the way I would get prompted if I were to do it manually using the get external data file menu option - any guidance from the TeKTips Gurus would be greatly appreciated.
The code that I am using follows:
Code:
Public Function marketmonthlyimport()
Dim strInput As String, strMsg As String
On Error GoTo Oppsnofile:
strMsg = "Enter Month and Year of your import like this MMMYY - MAR03 for example..."
strInput = InputBox(Prompt:=strMsg, _
Title:="DPMDataMaster Reporting Month Selection...", XPos:=2000, YPos:=2000)
DoCmd.SetWarnings False
DoCmd.OpenQuery "q-del-t-mm-allmkt"
DoCmd.TransferText acImportDelim, "Allmkts_month Import Specification", _
"t-mm-allmkts_month", "P:\SASCSVOutput\" & strInput & "\CSVProdMon\t-mm-allmkts_month.csv", -1
DoCmd.SetWarnings True
Exit Function
Oppsnofile:
DoCmd.SetWarnings True
End Function
John Kolker
Programmer
jwkolker@comcast.net