Files indexed with records?

T

Troy D. Young

I would like to display (on a form) a list of files in a folder on the file
system so that the user can double-click and open it from within Access.
The catch is, I'd like the folder to be relevent to the record being
displayed.

For example, I would like to have a contacts database that each record has
an account number, e.g. A020. Based on that record, I'd like to have the
root of the file locations preset, e.g. X:\FILES\CLIENTS (maybe in a
"database settings table"). So, the complete path on the file system is
X:\FILES\CLIENTS\A020 for this one particular record. Then, have a box in
the form window that displays the folder contents based on the account
number that has been appended to the file system location. If I'm looking
at client #C485, then the box would display all files in the
X:\FILES\CLIENTS\C485 folder.

Clear as mud?

Thanks,
Troy D. Young
 
A

Allen Browne

Would it do to just open a copy of the Windows Explorer to the folder? User
than then double-click any file they wish.
Code is one line, something like this:
Shell (Environ("WinDir") & "\Explorer /select, ""X:\FILES\CLIENTS\A020""")

If you want more, see help on Dir for listing the files in a folder.
Then to run the file by the program that's registered to handle that type,
see the ShellExecute API code at:
http://www.mvps.org/access/api/api0018.htm
 
T

Troy D. Young

Not optimum...I guess what I'd like to see is sort of a "FILE/OPEN" box on
the form that displays the contents of the folder. From there, the user
could double-click on the file and it would open in its associated
application just like from Windows Explorer.

Just my vision...doesn't mean it can easily be done :~)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top