Automated Hyperlink using concatenation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • speoples
    New Member
    • Oct 2012
    • 2

    Automated Hyperlink using concatenation

    I am trying to create an automated hyperlink in a form, based off of another field. Here is what I have so far in the after update event:

    ParkerDrawingHy perlink = "#C:\Docume nts and Settings\shapeo \My Documents\CYLIN DERS\Cylinder Drawings\#" & Me.ParkerDrawin g & "#.pdf#"

    This is working up to a point. It is opening the file folder on my hard drive where all the files are stored, but it is not opening the actual file.

    When I look at the automated field, the following result is being populated:

    C:\Documents and Settings\shapeo \My Documents\CYLIN DERS\Cylinder Drawings\ - gc613058a0

    The "gc613058a0 " is the name of the file it should be opening. I don't understand why it is adding the extra spaces and hyphen before it though.

    Any ideas?
  • speoples
    New Member
    • Oct 2012
    • 2

    #2
    Ok, played around with it some more and finally figured it out. YEA!!!!

    Here is how it should read:

    ParkerDrawingHy perlink = "#C:\Docume nts and Settings\shapeo \My Documents\CYLIN DERS\Cylinder Drawings\" & Me.ParkerDrawin g & ".pdf#"

    Comment

    • TheSmileyCoder
      Recognized Expert Moderator Top Contributor
      • Dec 2009
      • 2322

      #3
      I think you have some confusion about the use of #. They are normally used around DATES to indicate that they are dates and not merely a calculation. I suggest you take the time to look at these 2 articles to get a better understanding of the concept:
      Literal Datetimes and their delimiter #
      Quotes (') and Double-Quotes (") - Where and When to use them.

      Comment

      • Hoopla3000
        New Member
        • Oct 2012
        • 7

        #4
        Hyperlinks in Access have #'s too.

        Originally posted by TheSmileyCoder
        I think you have some confusion about the use of #. They are normally used around DATES to indicate that they are dates and not merely a calculation. I suggest you take the time to look at these 2 articles to get a better understanding of the concept:
        Literal Datetimes and their delimiter #
        Quotes (') and Double-Quotes (") - Where and When to use them.
        A hyperlink entry contains three parts separated by pound signs (#). The template is:
        display text # file name # any reference within the file

        The following link explains in more detail:
        How to use the Hyperlink field type in a Microsoft Access database, with examples.


        Hyperlink fields can be challenging to work with if you don't use them a lot. For storing paths where a clickable hyperlink is not needed, I have had less frustration by using ordinary text fields and using a button to launch the path.

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          Thank you Hoopla3000, for that explanation. As you can probably guess I don't work with hyperlinks alot, I just use ordinary text fields, and a button to launch the links, which are usually files on our server.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Good pickup Hoopla. I asked a question on this some time ago and the thread may prove helpful to those interested Error 7980: HyperlinkAddres s or HyperlinkSubAdd ress read-only for Hyperlink. I believe I linked into Allen Browne then too as it happens.
            Last edited by NeoPa; Oct 27 '12, 01:33 PM.

            Comment

            Working...