Want to automate the import of 1 to many .dbf files in a single shot (all the files have the same fields). found the following code at Microsofts site but this is not exactly what I'm looking for. I dont want to create new tables I just want to import all the records from multiple files and then export to one large .dbf file. Any help appreciated.
Private Sub Command0_Click()
Dim InputDir, ImportFile As String, tblName As String
Dim InputMsg as String
InputMsg = "Type the pathname of the folder that contains "
InputMsg = InputMsg & "the files you want to import."
InputDir = InputBox(InputMsg)
' Change the file extension on the next line for the
' type of file you want to import.
ImportFile = Dir(InputDir & "\*.dbf")
Do While Len(ImportFile) > 0
' Use the import file name without its extension as the table
' name.
tblName = Left(ImportFile, (InStr(1, ImportFile, ".") - 1))
' Change FoxPro 3.0 on the next line to the type of file you
' want to import.
DoCmd.TransferDatabase acImport, "FoxPro 3.0", InputDir, _
acTable, ImportFile, tblName
ImportFile = Dir
Loop
End Sub
If its possible to then move the imported .dbf files to a "done" folder that would be great also.
Private Sub Command0_Click()
Dim InputDir, ImportFile As String, tblName As String
Dim InputMsg as String
InputMsg = "Type the pathname of the folder that contains "
InputMsg = InputMsg & "the files you want to import."
InputDir = InputBox(InputMsg)
' Change the file extension on the next line for the
' type of file you want to import.
ImportFile = Dir(InputDir & "\*.dbf")
Do While Len(ImportFile) > 0
' Use the import file name without its extension as the table
' name.
tblName = Left(ImportFile, (InStr(1, ImportFile, ".") - 1))
' Change FoxPro 3.0 on the next line to the type of file you
' want to import.
DoCmd.TransferDatabase acImport, "FoxPro 3.0", InputDir, _
acTable, ImportFile, tblName
ImportFile = Dir
Loop
End Sub
If its possible to then move the imported .dbf files to a "done" folder that would be great also.