Results 1 to 12 of 12
  1. #1
    dizy8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    20

    How to rename hyperlink path name

    Hi guys,

    I have this button so that I can open a PDF file. Is there anyway where I can rename the hyperlink path? I want to change it to "soft copy". The coding of my button is below.

    Private Sub Command461_Click()


    Dim Fd As FileDialog
    Set Fd = Application.FileDialog(msoFileDialogFilePicker)
    With Fd
    .AllowMultiSelect = False
    .Title = "Select Only One File"
    .Filters.Clear
    .Filters.Add "Pdf file", "*.pdf*"

    If .Show Then
    For Each VtrSelectItem In .SelectedItems
    Me.Pdfcopy = VtrSelectItem
    Next VtrSelectItem
    Else
    'error when we cancel dialog box
    MsgBox "No file Selected", vbInformation, "Cancelled"
    Me.Pdfcopy = ""

    End If
    Set Fd = Nothing
    End With
    End Sub

  2. #2
    dizy8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    20
    I want to change the filepath below in the Pdfcopy column to "Soft copy"



  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Quote Originally Posted by dizy8 View Post
    I want to change the filepath below in the Pdfcopy column to "Soft copy"


    there is nothing below.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    If your field is a true hyperlink then you can modify the display text property to say "Soft Copy"; if you actually store the path as short text it won't work. But you can fake it on the form by using the code you have and simply adding a textbox with the control source: =Nz([Pdfcopy],"Soft Copy")
    Now hide or minimize the original control and you should be good to go....

    Some links for you if the field is set as hyperlink:
    https://www.access-programmers.co.uk...erlink.288466/
    https://www.access-programmers.co.uk...report.215530/

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    oddly enough if you look at the list of your posts it has a link but broken

    Click image for larger version. 

Name:	missing.png 
Views:	26 
Size:	15.7 KB 
ID:	49865
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    @moke123 I just tried both of them on my phone and they work for me ��.
    EDIT: sorry, I get it now, you were looking in the OP's profile for the list of posts....please ignore

  7. #7
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    Yea it looks like he posted a picture and referred to it being below but I don't think it worked.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,550
    Quote Originally Posted by moke123 View Post
    Yea it looks like he posted a picture and referred to it being below but I don't think it worked.
    Yes, this site lets you paste a picture (just as you can at AWF, but that stays pasted). Here it does not. Needs to be uploaded by Attachments button.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    dizy8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    20
    Hi guys,

    I have saved the attachment on this link.

    Access.pdf

    Thank you

  10. #10
    dizy8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    20
    Hi Vlad..I tried your suggestion but this is the result..Kindly see the link below. The "Soft Copy" is not clickable anymore and also it will change name only if under "Pdfcopy" is blank. Please see below link.

    Sample.pdf

    Thank you.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Are you saving path into a Hyperlink field or a normal text field?

    Access Hyperlink is composed of 3 parts separated by # character. http://allenbrowne.com/casu-09.html

    Can construct a clickable Hyperlink string from text field and if you want "Soft Copy" to display: ="Soft Copy#" & [fieldname] & "#"
    Set textbox IsHyperlink property to Yes.

    Also review: http://allenbrowne.com/func-GoHyperlink.html
    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.

  12. #12
    dizy8 is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    20
    Hi June!!!

    It's working perfectly!!! Thank you so much for your help and sharing your expertise!

    Daisy

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

Similar Threads

  1. About Hyperlink-File path problems
    By notrino in forum Forms
    Replies: 1
    Last Post: 10-03-2018, 11:22 AM
  2. Update hyperlink path
    By jobbie in forum Modules
    Replies: 7
    Last Post: 04-11-2018, 06:17 AM
  3. Replies: 2
    Last Post: 05-30-2017, 05:16 PM
  4. Replies: 4
    Last Post: 07-21-2015, 11:17 AM
  5. Insert hyperlink - ensure absolute path
    By jaworski_m in forum Programming
    Replies: 1
    Last Post: 02-04-2015, 11:39 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