locked
Run-time error '3001' RRS feed

  • General discussion

  • Hi all. Could anyone help me to reslove this error. This code been working fine with previous data i loaded just now so not sure why im getting an error when all data are in the same format. I pasted my code below with the row highlighted in debugging.


    Dim DB As Database
    Dim GL As Recordset
    Dim SQLStatement As String
    Dim CC As Recordset
    Dim TM As Recordset
    Dim FilePath As String
    Function ImportAccountMaster()
    Set DB = CurrentDb
    With Application.FileSearch
    .LookIn = "C:\Documents and Settings\101 November 06\11082006\MCDNOW\"
    .FileName = "MC*.txt"
    If .Execute(msoSortByFileName, msoSortOrderAscending) > 0 Then
    For i = 1 To .FoundFiles.Count
    FilePath = .FoundFiles(i)
    DoCmd.TransferText acImportFixed, "Account Master Export Specification", "Account Master", [FilePath]
    Next i
    End If
    End With
    End Function
    Function ImportAccountMasterExt()
    Set DB = CurrentDb
    With Application.FileSearch
    .LookIn = "C:\Documents and Settings\101 November 06\11082006\MCNOW\"
    .FileName = "MC*D.txt"
    If .Execute(msoSortByFileName, msoSortOrderAscending) > 0 Then
    For i = 1 To .FoundFiles.Count
    FilePath = .FoundFiles(i)
    DoCmd.TransferText acImportFixed, "AccountMaster-ext Specification", "AccountMaster-ext", [FilePath]
    Next i
    End If
    End With
    End Function
    Mission
    • Changed type Martin Xie - MSFT Wednesday, October 1, 2008 9:16 AM Redirect to VBA forum.
    Monday, September 29, 2008 5:56 PM

All replies