Automated Hyperlink

thecrunch

New member
Local time
Tomorrow, 08:59
Joined
Jun 21, 2019
Messages
7
Hello,

I have a table that has a calculated field named "Unique Sample Number". Each unique sample number has its own folder on the computer. There is a "Folder" field in the table which is a hyperlink field and when clicked it should open the folder for each individual sample.

I would like to create an automated hyperlink in the "Folder" field that is updated as new samples are added to the database.


I have tried to use a Before Change data macro to load the values needed. However, it is unfortunately not working.

The process I have tried is as follows:
SetField
Name = Folder
Value ="#S:\Technical Library" & [Unique sample number]" & "#"



Any help is appreciated!
 
are you missing a "backslash"? also extra double quote in [unique sample number], to correct:

Value ="#S:\Technical Library\" & [Unique sample number] & "#"

the first part of the hyperlink is the text that will be displayed, next part is the actual location link.
to show unique number as displayed text:
Code:
Value =[Unique sample number] & "#S:\Technical Library[COLOR="Purple"]\[/COLOR]" & [Unique sample number] & "#"
 
Last edited:
Thanks for the response arnelgp.
The missing backslash in my post was a typo.. The macro does not work with it.
 
are you creating a separate macro.
use Data macro instead.
on your table Design View, click Create Data Macro.
choose Before Change from the listbox:
enter:
Code:
[B]SetField[/B]
Name:  [Folder]
Value: [Unique sample number] & "#S:\Technical Library\" & [Unique sample number] & "#"

save your table.
 
Or abandon the Hyperlink type field for options:

1. calculate hyperlink in textbox ControlSource:
=[Unique sample number] & "#S:\Technical Library\" & [Unique sample number] & "#"
and set property of IsHyperlink to Yes

2. use FollowHyperlink in VBA.
Followhyperlink("S:\Technical Library\" & [Unique sample number])

Then don't need Folder field.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom