Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Posts
    3

    Unanswered: Hyperlink address for network file into email (never mind...got the answer) Duh

    Never mind... I got it. Using the Name property and .Hyperlink.Address.


    Can someone help me with the code to obtain just the hyperlink address from a hyperlink field?

    The value as pulled from the Access hyperlink field is:

    DisplayText#filelink#

    For the email I need:

    <file://filelink>

    I know how to build the "<File://" & filelink & ">", but not how to get just the filelink portion of the hyperlink field.

    Thank you in advance.
    Last edited by ShanghaiedMary; 11-30-09 at 15:26. Reason: Got the answer

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    You can use the HyperLinkPart() Function to get the HyperLinkAddress Part of the Value from an Hyperlink Field.

    Example: xy = HyperlinkPart(myhype, acAddress)

    Sample code that searches for a Model code in Table and when found extracts the HyperLinkAddress part from the HyperLink Field and sets the Value on the HyperLinkAddress Property of a Command Button for Opening a .PDF file from Net, when clicked, is given below:

    Private Sub cboModel_Click()
    Dim myhype, xy As String, xcboModel
    Dim db As Database, rst As Recordset

    xcboModel = Me![cboModel]

    Set db = CurrentDb
    Set rst = db.OpenRecordset("tblModel", dbOpenDynaset)

    rst.FindFirst "ModelID = " & Chr$(34) & xcboModel & Chr$(34)

    If Not rst.NoMatch Then
    Set myhype = rst![Hlink]
    xy = HyperlinkPart(myhype, acAddress)
    Me.cmdPDF.HyperlinkAddress = xy
    End If

    rst.Close
    End Sub

    Check the following Link for more details:

    LEARN MS-ACCESS TIPS AND TRICKS: Open Forms with Hyperlinks in Listbox
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    May 2009
    Posts
    3

    .Hyperlink.Address

    Thanks for the response. I already got the answer...very simple.

    .Hyperlink.Address

    Have a great day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •