Results 1 to 3 of 3

Transferdatabase Acexport Actable Run-time Error '3024', Access 2016

  1. #1
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    38

    Transferdatabase Acexport Actable Run-time Error '3024', Access 2016

    I originally posted this last week at Utter Access, but have not received any replies there.



    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 MonthEndDataTablesFY2019.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
    The MsgBox returns the correct path.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    13,687
    I have approved the post for public display. Why MonthEndDataTablesFY2019.accbd?
    Is this just a typo???

    Code:
    strMonthendDB = "C:\MonthEndDataTables.accbd"

  3. #3
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    38
    Don't you hate when you do something stupid?

    Thanks for the pick-up.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-17-2018, 07:44 AM
  2. Run Time Error 3024
    By dccjr in forum Programming
    Replies: 9
    Last Post: 05-01-2013, 08:11 PM
  3. Replies: 1
    Last Post: 04-30-2013, 04:44 PM
  4. Error 3024 At Start UP
    By Damonpc in forum Access
    Replies: 10
    Last Post: 11-26-2010, 06:40 PM
  5. getting error using docmd.transferdatabase
    By haggisns in forum Import/Export Data
    Replies: 1
    Last Post: 11-02-2010, 07:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums