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
Option Compare Database
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
Option Compare Database
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