none
Edit hyperlink texttodisplay and address RRS feed

  • Question

  • Hello,

    I want to write code to change the texttodisplay and address of several hundred pdf (hyperlink field) in a Access 2007 table.

    Field name is "pdf"

    sample code below is not complete. The line after the edit will change both texttodisplay and address to what is between the 2 quotation marks. 

    How do I change the texttodisplay ?  

    Dim dbinfo1 As DAO.Database
    Dim char1 As DAO.Recordset

    char1.MoveFirst

    cont1:

    If char1![ref #] = "236" Then
    With char1
    .Edit

    char1!pdf = "#I:\Everyone\MSDS Database\MSDS PDF folder\214.pdf#"

    'remaining code...

    Monday, March 7, 2016 8:27 PM

Answers

  • Hi. Try something like:

    char1!pdf = "TextToDisplayHere#HyperlinkAddressHere#"

    So, if you're using variables, try something like:

    char1!pdf = varTextToDisplay & "#" & varHyperlinkURL & "#"

    Note: I'm not even sure the last "#" is necessary.

    Hope that helps...

    • Proposed as answer by David_JunFeng Tuesday, March 8, 2016 1:08 AM
    • Marked as answer by David_JunFeng Sunday, March 20, 2016 2:17 PM
    Monday, March 7, 2016 9:09 PM

All replies

  • Hi. Try something like:

    char1!pdf = "TextToDisplayHere#HyperlinkAddressHere#"

    So, if you're using variables, try something like:

    char1!pdf = varTextToDisplay & "#" & varHyperlinkURL & "#"

    Note: I'm not even sure the last "#" is necessary.

    Hope that helps...

    • Proposed as answer by David_JunFeng Tuesday, March 8, 2016 1:08 AM
    • Marked as answer by David_JunFeng Sunday, March 20, 2016 2:17 PM
    Monday, March 7, 2016 9:09 PM
  • Hi,

    Works perfectly !!

    Thanks for the fast response.

    I appreciate your help.

     
    Monday, March 7, 2016 9:52 PM
  • Hi. Your welcome. Glad we could assist. Good luck with your project.
    Monday, March 7, 2016 9:54 PM