listing files in a directory

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

Guest

I was able to follow Allen Browne's directions for listing files in a
directory using his Tip: List Files Recursively and setup a list box that
displayed all the files in a specific directory. It does work but need to
make a few adjustments, if possible.

1. His instructions say to put the following event procedure in the "On
Load" property: Call ListFiles("C:\Data",,,Me.1stFileList) I am using
Access 2003 and can not locate the "On Load" property. I assigned the code
to the "On Enter" property. So it will only list the files if I click in the
field.

2. All of the files listed in the list box have the entire file path listed.
This takes up considerable room since it is reading the directory from a
network drive. Is there a way to have it only list the file name?

Thanks in advance for any help!
 
1. The onload event is a form event not a control event.

2. Without a link to see his code I cannot tell you exactly how-to do it,
but yes I'm sure you can. Normally you'd use Instr(), Mid(), Len() and other
functions such as these to extract the filename for the path. provide me
with a link to allens code I we'll see what we can do.
 
Back
Top