Results 1 to 5 of 5
  1. #1
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9

    Opening hyperlinks in a multiple records form

    Hello,



    I have a field in my table with hyperlinks that are specific to each record. In my form, I want to be able to open the hyperlinks when on each specific record. I know how to do this using a textbox control, but I don't like how the entire file location is displayed in the text box on the form. Is there a way to hide this file location and instead display the words "Click to open this hyperlink" in the textbox? If this isn't able to be done, is it possible to create a Command Button that opens the hyperlink for each specific record (I know the command button is usually a fixed control that doesn't change for each record). Are there any other solutions to this issue? I simply want to be able to open the hyperlinks without having the file locations visible. Also, I would prefer not to have to use VB!

    Thank you!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Unless you store the file path in a Hyperlink type field, I don't think can avoid VBA.

    Example from my db:

    Private Sub btnLink_Click()
    On Error GoTo ErrProc
    'FollowHyperlink is not working properly
    ''Application.FollowHyperlink strPath
    Dim wsShell As Object
    Set wsShell = CreateObject("WScript.Shell")
    wsShell.Run Chr(34) & Me.tbxLink & Chr(34)
    Me.Title.SetFocus
    ExitProc:
    Set wsShell = Nothing
    Exit Sub
    ErrProc:
    MsgBox "Cannot open document. Contact database administrator. : " & Err.Number
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9
    @june7 :

    Can you specify where this code is used? Is this for a textbox or a Command Button? I'm still very new to VBA and am getting lost in your code. Thank you!

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    if it is a hyperlink control, enter whatever you want the user to see in the caption property (found on the properties other tab)

    ignore my suggestion - not appropriate for continuous forms/datasheet

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    It is code from button:

    Private Sub btnLink_Click()

    tbxLink referenced in code is a hidden textbox with expression that constructs the file path.
    ="C:\CRM\Library\Materials Reports\Catalogued\" & [DocID] & ".pdf"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Opening HyperLinks from a Combobox.
    By Torinjr in forum Forms
    Replies: 3
    Last Post: 05-06-2015, 03:27 PM
  2. Replies: 3
    Last Post: 09-29-2014, 04:13 PM
  3. Replies: 13
    Last Post: 07-27-2014, 12:12 AM
  4. Replies: 1
    Last Post: 03-02-2012, 10:24 AM
  5. Opening a form using multiple queries
    By jpeat in forum Forms
    Replies: 5
    Last Post: 01-24-2012, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums