Troubleshoot Hyperlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mvlt
    New Member
    • Apr 2007
    • 6

    #1

    Troubleshoot Hyperlink

    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_C lick()
    ' This requires a reference to the Microsoft Office 11.0 Object Library.

    Dim fDialog As Office.FileDial og
    Dim varFile As Variant

    ' Set up the File dialog box.
    Set fDialog = Application.Fil eDialog(msoFile DialogFilePicke r)
    With fDialog
    ' Allow the user to make multiple selections in the dialog box.
    .AllowMultiSele ct = 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
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Open the form in form view rather than design view. Right click on the control and Edit hyperlink. Make sure it is set to open a file rather than a website or email

    Comment

    Working...