Code Showing files

michalgut25

Registered User.
Local time
Today, 12:49
Joined
Jan 28, 2013
Messages
15
I have bound form multiple items with 2 fields "path", "files" and one button "show files".
Would like to, past path to one of them, like e.g. (C:\MyFiles) click button "show files" and in the other field should appearing files from destination (c:\Myfiles) e.g (x.pdf, z.doc, y.tiff).

Is it possible to do? It would be great! But I don't know vba very well:/ Please help!
 
This could be done by using Application.FileSearch, this method would use the path and retrieve all file names from that folder, you'd need to use a temporary table to hold the list of file names if you want to display the results in the form of a list or query, but not necessary when displayed as a concatenated string (as above x.pdf, z.doc, y.tiff) in a text box

David
 
Think it could be a field, Data type "Memo" with "Rich text" to have something like this:
"1. x.pdf
2. y.tiff
3 z.doc"

I found some code:
Code:
With Application.FileSearch
    .NewSearch
    .LookIn = "C:\My Documents"
    .SearchSubFolders = True
    .FileName = "Run"
    .MatchTextExactly = True
    .FileType = msoFileTypeAllFiles
End With
But how can I match this code with query to have desired results?
 
Hi michalgut25, I am not sure if I actually follow you.. In Post#1 you mentioned..
michalgut25 said:
with 2 fields "path", "files" and one button "show files"..
If this is all you want is it not as simple as using FollowHyperlink method?

So in your other field, where it has the file name you have a list of files.. Do you wish to open all files in the memo list?
 
Hi pr2-eugin first of all I describe my problem:
e.g. I writing order number 1:
I'm creating a new folder in my disk e.g. C\Myfiles\ClientX\27-03-2013
then I past files into that folder e.g. x.pdf, z.doc, y.tiff.
Then I copy path from Window "C\Myfiles\Clientx\27-03-2013"
and past to filed "path" in my form (multiple items).
------------------------------------------------------
That's the point:
I want to have list of files from this folder in my form, so It would be great when I will do this automaticly using button.
Like: I click button "show files" and next filed "files" appear the list of file from my folder.
------------------------------------------------------
Next problem:
It would be really great if I will click on the name of file in my form e.g. "x.pdf" and open it. but I'm not sure that, is it possible to do? If not, I can have only a list of files.

Memo with rich text:
1. x.pdf
2. z.doc
3 y.tiff

Or if above isn't possible:
x.pdf; x.doc; y.tiff
 
Last edited:

Users who are viewing this thread

Back
Top Bottom