J
jln via AccessMonster.com
OK New problem I have it running now but it doesnt stop looping until the
table is filled. Did I miss something?
Private Sub Command0_Click()
Dim StrFolder As String
Dim strFileName As String
Dim strFullName As String
Dim dbf As Database
Const conFilter As String = "\*.xls"
Set dbf = CurrentDb
StrFolder = BrowseFolder("Select Folder For Imports")
If Len(StrFolder) = 0 Then
MsgBox "Import Canceled"
Exit Sub
End If
strFileName = Dir(StrFolder & conFilter)
Do While Len(strFileName) <> 0
strFullName = StrFolder & "\" & strFileName
DoCmd.TransferSpreadsheet acLink, , "PayoffMisMatch", strFullName, True
dbf.Execute ("qry_PayoffMismatch"), dbFailOnError
DoCmd.DeleteObject acTable, "PayoffMisMatch"
strFileName = Dir()
Loop
Set dbf = Nothing
End Sub
table is filled. Did I miss something?
Private Sub Command0_Click()
Dim StrFolder As String
Dim strFileName As String
Dim strFullName As String
Dim dbf As Database
Const conFilter As String = "\*.xls"
Set dbf = CurrentDb
StrFolder = BrowseFolder("Select Folder For Imports")
If Len(StrFolder) = 0 Then
MsgBox "Import Canceled"
Exit Sub
End If
strFileName = Dir(StrFolder & conFilter)
Do While Len(strFileName) <> 0
strFullName = StrFolder & "\" & strFileName
DoCmd.TransferSpreadsheet acLink, , "PayoffMisMatch", strFullName, True
dbf.Execute ("qry_PayoffMismatch"), dbFailOnError
DoCmd.DeleteObject acTable, "PayoffMisMatch"
strFileName = Dir()
Loop
Set dbf = Nothing
End Sub