UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Transferdatabase Acexport Actable Run-time Error '3024', Access 2016    
 
   
dashiellx2000
post Jan 4 2019, 09:39 AM
Post#1


UtterAccess VIP
Posts: 9,829
Joined: 11-March 05
From: Maryland


Front end used to manage downloads and report writing. In this case, I want to import month end data files, push the table to the MonthEndDataTables.accbd and then relink to the front-end. However, I keep getting Run-Time error 3024 and cannot get the table to export.
Here is my code so far:

CODE
Private Sub cmdImportDataFiles_Click()
Dim strMonthendDB As String
Dim strSQL As String
Dim rstData As DAO.Recordset
Dim strSourceDirectory As String
Dim strImportSpec As String
Dim strDownloadTable As String
Dim strDestination As String
Dim objFS As Object
Dim objFolder As Object
Dim objFiles As Object
Dim objFile As Object

strMonthendDB = "C:\MonthEndDataTables.accbd"
'Create SQL string to get list of all monthly source files
strSQL = ""
strSQL = strSQL & "SELECT SourceFileID, SourceFileDescription, SourceFileLocation, ImportSpecification, DownloadTableName, BackupLocation"
strSQL = strSQL & " FROM tblSourceFiles WHERE [ePremis]=False AND [Frequency]='Monthly'"
Set rstData = CurrentDb.OpenRecordset(strSQL, dbReadOnly)
Do Until rstData.EOF
    strSourceDirectory = rstData(2)
    strImportSpec = rstData(3)
    strDestination = rstData(5)
   Set objFS = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFS.GetFolder(strSourceDirectory)
    Set objFiles = objFolder.Files
    Select Case rstData(0)
        Case 14 'Month End AR Summary
            For Each objFile In objFiles
                If Left(objFile.Name, 9) = "ARSummary" Then
                    strDownloadTable = rstData(4)
                    'Replace str "FacilityCode" with the facility code embedded in the File Name.
                    strDownloadTable = Replace(strDownloadTable, "FacilityCode", Mid(objFile.Name, InStr(objFile.Name, "_") + 1, 3))
                    'Replace str "MMMMYYYY" with the date embedded in the File Name.
                    strDownloadTable = Replace(strDownloadTable, "MMMMYYYY", MonthName(Mid(objFile.Name, 10, 2)) & Mid(objFile.Name, 14, 4))
                    DoCmd.TransferText acImportDelim, strImportSpec, strDownloadTable & "_Temp", objFile
                    MsgBox strMonthendDB
                    DoCmd.TransferDatabase acExport, "Microsoft Access", strMonthendDB, acTable, strDownloadTable & "_Temp", strDownloadTable, False
                End If
            Next objFile
        Case 15 'Month End Financial Transaction Summary
        
        Case 16 'Month End AR Detail
    
    End Select
    Set objFiles = Nothing
    Set objFolder = Nothing
    set objFS = Nothing
    rstData.MoveNext
Loop
rstData.close
set rstData = Nothing
End Sub


Here is what the MsgBox Returns:


And here's the error box:


--------------------
William
“We're run by the Pentagon, we're run by Madison Avenue, we're run by television, and as long as we accept those things and don't revolt we'll have to go along with the stream to the eventual avalanche"
Go to the top of the page
 
GroverParkGeorge
post Jan 4 2019, 09:56 AM
Post#2


UA Admin
Posts: 35,172
Joined: 20-June 02
From: Newcastle, WA


Hm. Where did you place the images for your links?


--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
dashiellx2000
post Jan 4 2019, 10:03 AM
Post#3


UtterAccess VIP
Posts: 9,829
Joined: 11-March 05
From: Maryland


Getting all excited that someone had an answer for me. Now I'm sad. sarcasm.gif

I posted them at imgur

--------------------
William
“We're run by the Pentagon, we're run by Madison Avenue, we're run by television, and as long as we accept those things and don't revolt we'll have to go along with the stream to the eventual avalanche"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    24th June 2019 - 04:41 PM