Making table from files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to make a table from all the files in a folder... I want these
records to be imported easily ... I don't want to be forced to type each and
every filename in as a record.
 
here's the code i use in one of my dbs:

Public Function isFiles() As String

' On Error Resume Next

Dim str As String
str = Dir("put the folder path here" & "*.*")

Do Until str = ""
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO TableName ( FieldName ) " _
& "SELECT '" & str & "'", False
DoCmd.SetWarnings True
str = Dir
Loop

End Function

hth
 
Back
Top