Create query that shows file names and paths

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

Guest

i would like to creatre a query that displays the names of files and the full
path. to allow the path to be stored as a hyperlink on a form.

could somebody please show me what is required to do it.

Many thanks
 
As far as putting file paths into a query I don't want your set up is, but I
can help you with part 2 at least.

Put the following in the "on click" event of the button. The second line
contains the query column name and then the name of the query itself.


Dim varURL As Variant

varURL = DLookup("[File]", "Query2")

If IsNull(varURL) Then
MsgBox "Sorry, this document does not exist!", vbOKOnly + vbInformation
Else
Application.FollowHyperlink varURL
End If
 
PS. If you use your query as the source of your form, use a continuous form
and put the button on the record row so you have a button for each file path.
That should work (hopefully).
 
PPS. In the query you can concatenate fields however you like:

[field1] & " " & [field2] & "\" & [field3]

will put a space and a backslash between the three fields

or

[field1] & [field2] & [field3]

to have no spaces between fields.

Hope this helps
 
Thanks Scuba,

but i need some example code to list the files on a networked drive in my
case this is "Y:\Final Account Details\Final
Accounts_OLO\Schedules\Pending\Company name"
 

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

Back
Top