I am working with a database in Access 2003. I have set up a form with a button that pulls up the Windows File Dialog box and allows the user to search for a specific file to input into a field. The field, called FileLink is set as a hyperlink field. This process functions well - the resulting file path appears in the appropriate field in the table, but it is not actually a hyperlink. There is no data underneath it.
How can I get it to be input as an actual hyperlink? The code I am using for the dialog box is as follows:
Private Sub cmdFileDialog_Click()
' This requires a reference to the Microsoft Office 11.0 Object Library.
Dim fDialog As Office.FileDialog
Dim varFile As Variant
' Set up the File dialog box.
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
' Allow the user to make multiple selections in the dialog box.
.AllowMultiSelect = False
' Clear out the current filters, and then add your own.
.Filters.Clear
.Filters.Add "All Files", "*.*"
' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then
Me.FileLink = .SelectedItems(1)
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With
End Sub