Hyperlink in Query Datasheet

G

Guest

Hi, I hope you can help me out. I have a field in a database which holds a
file name. All of the files I want to reference are in one folder. I would
like to be able to call a query and have it calculate the path to the file
and put that in the field as a hyperlink. Example below.

\\test\folder\ folder where all of the files are.
file1.doc name of the file

\\test\folder\file1.doc the text and where the hyperlink should point.

If I'm going about this the wrong way, let me know. Any suggestions are
appreciated.
 
A

Allen Browne

If you are using a very recent version of Access, you can set the
HyperlinkBase property under:
File | Database Properties | Summary
to:
\\test\folder\
You can then just store the File1.Doc part in a field named (say) FileName.
Set the Text Box's IsHyperlink property to Yes.

Alternatively, you can put a text box for the FileName field on your form,
and use its Click (or DblClick) event procedure to:
If Not IsNull(Me.FileName) Then
FollowHyperlink "\\test\folder\" & [FileName]
End If

If you want it construct a full hyperlink with the display and address
components, use:
=[FileName] + "#\\test\folder\" + [FileName] + "#"
 

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