Dynamically link to documents in Access

  • Thread starter Thread starter scott
  • Start date Start date
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?
 
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
 
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.
 
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"
 
Back
Top