Access 2003 form hyperlinks

  • Thread starter Thread starter kuslusr1
  • Start date Start date
K

kuslusr1

I have a form with multiple records, starting with number one 1 and ending at
400. Each access record has subfolder containing information like word
documents, pdfs and jpegs. The subfolder names are formatted like "HAZS00001"
THROUGH HAZS0000400". I would like to know how to run code that would load
the correct path to folder in a text box on the associated record.
 
Alright, I do this in my access databases as well. What you need to do is use
the VBE. Create a button that has an event on it. For an example this is how
it would look. On the main form you would have a textbox or combobox that you
type in the name of the file you want... so the code would do this

Set up the path name

Dim mypath as String
Dim file_name as String

mypath = "C:\\yourpathhere\"
file_name = Me.yourtextorcomboboxhere

mypath = mypath & file_name

FollowHyperlink mypath

The other way to do this is to set up the path in a table within access...
this is in case you have more then 1 drive set up or folder names. Then you
can use a DLookup to retrieve the path and then FollowHyperlink to that path.
 
Back
Top