Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create Hyperlink (2003)

    My database enables me to send emails to my contacts. I have an 'attachment' radio button which enables me to select an attachment to go with the email if necessary. The path to such attachment is saved as part of my message using the variable FILEN.

    I have a field called LETTER in which I record a hyperlink to any document which is important to that particular contact information.

    Now I want my database to automatically create a hyperlink to any attached document and place that hyperlink in the LETTER field.

    I've tried various ways but can't seem to get this to work - how can I do this?

    Thanks in advance.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Hyperlink (2003)

    If you already have a field FILEN that contains the path of the atttachment, why do you need a separate hyperlink field? You can open the document using

    Application.FollowHyperlink Me.FILEN

    for example in the On Click event of a command button.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Hyperlink (2003)

    Hi Hans,
    my hyperlink field (LETTERS) is a hyperlink field. When I select the attachment the code assigns the name of the attachment to the variable FILEN and sends it. I then used the code me.letters = filen however the LETTERS field no longer acts as a hyperlink to the document. I tried other variations using the examples in Help but couldn't get it to work.
    So what I want is the name of the attachment in the LETTERS field so that when I click on the field the document is loaded.

    Thanks again.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Create Hyperlink (2003)

    I repeat, if you already have the path/filename in the FILEN field, it is redundant to also store exactly the same information in a hyperlink field. I tried to indicate how you can still open the document without using a hyperlink field.

    However, if you still want to do so, use
    <code>
    Me.LETTERS = "#" & Me.FILEN & "#"
    </code>
    A hyperlink field is stored as a string with 3 parts, separated by # characters.
    The first part is the text that will be displayed; if this is empty, the displayed text is that of the second part.
    The second part is the actual hyperlink address, i.e. the URL, or the path+filename.
    The third part is the subaddress, if needed.
    The first and last part can be omitted.

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    342
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create Hyperlink (2003)

    Hi Hans,
    You misunderstand - FILEN is a variable, not a field. However your code worked when adjusted as follows:
    Me.Letter = "#" & filen & "#"
    Thanks very much - mission achieved!
    Cheers.

Posting Permissions

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