Hyperlinks (1 Viewer)

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
Hi - I have a current table which is linked to excel. In excel I have a column which contains a hyperlink to a specific folder for each row.

In Access I want to have this hyperlink on a from so that each record has a link which points it to a different folder on my drive. In the design view of the table I have tried to change the data type to hyperlink but I just get the error message operation is not supported for this type of object. I have also tried changing a blank column to hyperlink data type but get the same message.

Any ideas where I am going wrong?


Thanks in advance
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:40
Joined
Oct 29, 2018
Messages
21,360
Hi. Are you saying you’re trying to modify the design of a linked table to Excel?
 

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
Yes I think so - sorry new to all this.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:40
Joined
Oct 29, 2018
Messages
21,360
Well, if that’s the case, you won’t be able to, because linked table designs are not changeable. In any case, you won’t really need to change the table design anyway. You should be able to use code to make the hyperlink work. For example, you could try the FollowHyperlink method.
 

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
Okay I see, sorry what is the FollowHyperlink method and how do I use this in access?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:40
Joined
Oct 29, 2018
Messages
21,360
You would use it on a form. For example, in the Click event of the field or a button, you could try Application.FollowHyperlink [FieldName]
 

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
Thanks - okay so this is what is now showing. Is that right? Lease is the column name in my excel table. The control source us set to Lease.

Private Sub Text172_Click()
Application.FollowHyperlink [Lease]
End Sub

I am getting a message saying Run time error 94 - invalid use of null. Any ideas?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:40
Joined
Oct 29, 2018
Messages
21,360
Hi. If you’re getting that error, it means Lease is empty. Try the code on a non-empty field.
 

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
That’s strange because that’s the column in excel that contains the hyperlinks for each row?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:40
Joined
Oct 29, 2018
Messages
21,360
What is the value of Lease when you click on the form?
 

Cronk

Registered User.
Local time
Tomorrow, 02:40
Joined
Jul 4, 2013
Messages
2,770
Why do you expect Access to know that some unnamed spreadsheet has a column named Lease?


In Access, create a link to your spreadsheet ie a linked table. If the column named Lease in Excel has the entry Lease in the first row of the column, Access will allocate that to the field name in Access. If not, in Access the field will be called Fx where x is the column number in Excel.


You did not indicate whether there is one hyperlink or many. If the latter, you could use dLookup() to get the hyperlink for a particular row. Without more information about the names of the linked table fields and which contains the search information, I cannot be more specific.
 

Accessbeginner34

Registered User.
Local time
Today, 15:40
Joined
Mar 16, 2019
Messages
31
Hi - the Access table is linked to a table in Excel which has the header Lease. Within this column in Excel (AO) most (but not all) of the rows have a hyperlink which leads to a folder where the lease for the property on that row is saved on the network drive.

So in access I want to have a link for each record to the relevant hyperlink in the table and therefore the lease folder on the network drive. I have tried to follow the advice given before and set the Text Box control source to the Lease field and added an event on Click of

Private Sub Text172_Click()
Application.FollowHyperlink [Lease]
End Sub

I am no longer getting the error message I had before and the text box is now displaying the hyperlink from the excel table but when I click on it nothing happens.

Any suggestions. thanks.
 

Users who are viewing this thread

Top Bottom