Access does not have the standard DirListBox and FileListBox VB
controls. Therefore, in order to read folder and file information, you
must use code. Although the TreeView OCX works the best for this since it ends up
resembling Windows Explorer the most, we're limited to using Listboxes with a
standard Access install since the OCX only ships with ODE.
This job is easiest done by a Class module which returns the names
of all the files and subfolders in a particular location. This sample database contains
the DIR Class Module, along with the API code required to find the installed drive
letters. In addition, I've included the ShellExecute code as well so that
double-clicking an entry in the File Listbox will either execute the file using it's
parent application, or if the file type in not known, it will bring up the Open With
dialog.
Download
Explorer.zip. Access 97 version.
|