Article ID: 158940
Article Last Modified on 1/19/2007
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
88764 ACC: How to Import several dBASE Databases at Once (1.x/2.0)
141611 ACC: How to Import several dBASE Databases at Once 95/97
Additional query words: programming directory
Keywords: kbhowto kbprogramming KB158940