Retriving file names from a folder into Access table

  • Thread starter Thread starter Ralph
  • Start date Start date
This method uses DOS to build a text file.
Click on START then RUN. Enter CMD and then click OK.
This opens a DOS window.
Use CD.. to move one level up in folder structure.
Use CD <folder name> to go to lower level folder.
Use <drive letter>: to change drives.
When you are at the correct drive, use DIR to list files
and folders. Use DIR/S to list files and files in lower
folders.
Use DIR/S > Myfilelist.txt to create a text file with all
the file names.

When you finish you can click to close the window.

Some folks still use DOS.
 
New Access user. Can I get file names from a folder into
an Access table?

The VBA Dir() function returns filenames; repeated calls to Dir() will
return additional filenames. You can open a recordset and loop through
it using the AddNew method to insert the names that Dir() finds. See
the VBA online help for Dir.

John W. Vinson[MVP]
 
Back
Top