Results 1 to 9 of 9
  1. #1
    stalk is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    May 2014
    Posts
    143

    How to automatically link a hyperlink field based on other field in the same record?

    I've a vendor field and would like to auto-populate the record_location hyperlink field to point to that vendor subfolder when a new record is entered. This is to see any related documents from that vendor. Is that possible? If so where should I give that.



    I don't want to attach any document but would like to have hyperlink in that record, pointing to that path.

    Thanks in advance.

  2. #2
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    If record_location is going to be "auto-populate"'d, why can't you use a double-click event (for example) on vender to open Windows Explorer to that folder? Then you wouldn't need the record_location field at all.

    example: Shell "C:\WINDOWS\explorer.exe """ & Foldername & """", vbNormalFocus

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    OnClick of button or AfterUpdate on field. If the path needs to be the value of another field, then build it in code.

    Application.FollowHyperlink "C:\YourFolder"
    or
    Application.FollowHyperlink "C:" & me.VendorName

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Suggest on the AfterUpdate of the vendor control, you set the hyperlink control value by using DLookup to get the path. This assumes you have a path field and vendor field in a table or query from which you can retrieve the path according to the vendor value in the vendor control.
    Last edited by Micron; 03-27-2017 at 11:46 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Could also do something like this with a label:

    Me.Label4.HyperlinkAddress = "http:\\www.cnn.com"
    Me.Label4.Caption = "cnn"

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I think the property is label.Hyperlink and not label.HyperlinkAddress?

  7. #7
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    When I tested it needed HyperlinkAddress but he can try it and see what works.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    Thanks, I was just going by what the object browser and Access help states.

  9. #9
    stalk is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    May 2014
    Posts
    143
    You guys Rock!!!!! My issued is fixed. I used the following code to update my hyperlink field automatically in FORM as well as table based on vendor..

    Private Sub Vendor_AfterUpdate()

    Me.service_rec = "#" & "c:\Service_Records" & Me.Vendor & "#"

    End Sub

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

Similar Threads

  1. Replies: 9
    Last Post: 06-12-2014, 01:36 PM
  2. Hyperlink field based on other field
    By jonny in forum Access
    Replies: 13
    Last Post: 05-25-2013, 12:31 PM
  3. link to 100's images based on field name
    By MyWebdots in forum Import/Export Data
    Replies: 1
    Last Post: 11-08-2010, 02:45 AM
  4. Replies: 2
    Last Post: 09-20-2010, 09:02 PM
  5. Replies: 4
    Last Post: 01-19-2010, 05:36 AM

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