I have a problem that I have been struggling with for some time. Here is the code:
Private Sub cmdWireRoomFeeProcessCharges_Click()
strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.WireRoomDownloadImportTableDelete"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords
Dim dkg As Variant, str As String
dkg = Application.FileDialog(msoFileDialogFilePicker).Show
str = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)
DoCmd.TransferText acImportDelim, "WireRoomImportSpecification", "Wire_Room_Download_Import_Table", _
str
On Error GoTo mytrap
strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.WireRoomDownloadUpdate"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords
Exit Sub
mytrap:
Msgbox "Error in input file"
Resume Next
DoCmd.TransferText acExportFixed, "Night_Fills_ Export_Specification", "Wire_Room_Download_File_Query", "W:\Accounting\Access Globex Downloads [Night Desk Fees]\AWire_Room_Download_File_Query.txt"
The problem is that the final transfertext does not work! No file gets transferred out of the sub. When I comment out all of the code involved with the onerror the transfertext works. I have googled this thing to death with no answer. Any leads to the answer would be greatly appreciated. Thanks.
Private Sub cmdWireRoomFeeProcessCharges_Click()
strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.WireRoomDownloadImportTableDelete"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords
Dim dkg As Variant, str As String
dkg = Application.FileDialog(msoFileDialogFilePicker).Show
str = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)
DoCmd.TransferText acImportDelim, "WireRoomImportSpecification", "Wire_Room_Download_Import_Table", _
str
On Error GoTo mytrap
strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.WireRoomDownloadUpdate"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords
Exit Sub
mytrap:
Msgbox "Error in input file"
Resume Next
DoCmd.TransferText acExportFixed, "Night_Fills_ Export_Specification", "Wire_Room_Download_File_Query", "W:\Accounting\Access Globex Downloads [Night Desk Fees]\AWire_Room_Download_File_Query.txt"
The problem is that the final transfertext does not work! No file gets transferred out of the sub. When I comment out all of the code involved with the onerror the transfertext works. I have googled this thing to death with no answer. Any leads to the answer would be greatly appreciated. Thanks.