Dynamically link to documents in Access

S

scott

I have a database the keeps track of work requests. Each request is
independently numberred (1, 2, 3, etc.). This is autonumberred in
Access. There is one word document associated with each request.
These word documents are stored at an http accessible location like

http://www.name.com/file1.doc
http://www.name.com/file2.doc
http://www.name.com/file3.doc

The number in the file name corresponds to the work request number.
Is there a way to dynamically generate a hypelink field that uses
another field name in the path like this?
 
G

Guest

Hi Scott,

If the field with the autonumber is named "DocID", you can do stuff like
this in the Click event procedure of a button on a form that's displaying
records from the table:

Dim DocURL As String
Const BASE_URL As String = "http://www.name.com/"
Const BASE_NAME As String = "File"

DocURL = BASE_URL & Me.DocID.Value & ".doc"
Application.FollowHyperlink DocURL
 
D

diveatlas

What I would like to do is actually have this path automatically
generated and placed into a table when a new record is created. I am
using MS QUery to generate excel based reports, & I'd like this link
to show up in the reports. I can do this if the hyperlink is in a
table.
 
J

John Nurick

I'm not really familiar with MS Query, but assuming it uses SQL you
could probably just use a calculated field in the query

SELECT "http://www.name.com/file" & [DocID] & ".doc" AS DocLink

Otherwise, add a hyperlink field to the table and use an update query
along these lines to populate it.

UPDATE MyTable
SET DocLink = "http://www.name.com/file" & [DocID] & ".doc"
 

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