Hyperlink

H

Harley Feldman

I have a field in a table which is type hyperlink. The values in the fields are put there by a form which calls Microsoft Office 11.0 Object Library where I call the Application.FileDialog(msoFileDialogOpen) class module. Once the file is selected, the correct absolute URL address of the file is placed in the field.

However, when I click on the link in a form built from this table, the folder where the database is stored opens - not the file pointed to be the hyperlink. I converted the hyperlink field to text and added the following code:

Public Function FileOpen()
Dim fd As FileDialog
Dim vrtSelectedItem As Variant
Set fd = Application.FileDialog(msoFileDialogOpen)
With fd
.AllowMultiSelect = False
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
FileOpen = vrtSelectedItem
Exit For
Next vrtSelectedItem
Else
FileOpen = ""
End If
End With
Set fd = Nothing
End Function

This code works by executing the FileDialog class if the field is empty and following the hyperlink if there is a file name in the field. The problem is that the field looks like any other text field (dataform view), and I would like it to look like a hyperlink (underlined with finger pointer). What is it that I don't understand about hyperlinks in Access fields?

Harley
 

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