Results 1 to 3 of 3
  1. #1
    Sck is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2010
    Posts
    82

    Convert string data type to Hyperlink in HTML email

    I have an Access database the creates an email with HTML formatting with body of the email populated based on a query result. One of the results is a text string that is a link to a specific location on a server. in the email that is created, i want the path/link to be a hyperlink so the receiver can just click on it. I dont have ability/rights to change the field type in the table so that is not an option. below are the parts of the code that i am tying to use.

    Dim SEvd as string
    Dim hyp As Hyperlink

    SEvd = rst!SEvidence
    Set hyp = "#" & rst!SEvidence & "#"

    EMAIL BODY HTML section for hyperlink
    Review Folder: <b><a href = " & hyp.Address & ">" & SEvd & "</a>" & "</b>. <br><br>" & _



    it is erroring out on the Set statement with Object Required error

    rst!SEvidence contains something like \\xacv\testeval\mg\ as the string.

    I understand why but i dont know how to "fix" it.

    any help is appreciated

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    SET is for objects only so the message is saying you haven't created one. Hyperlink is a property of string data type.
    Dim your variable as a string and make it = the string.
    Do follow the link as it looks like good info (you'll also see that a string variable is used for the hyperlink).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Add Query Field Data to an HTML Email Module
    By MSAccessOldTimer in forum Modules
    Replies: 22
    Last Post: 02-11-2021, 12:16 PM
  2. Convert String To Hyperlink
    By DMT Dave in forum Access
    Replies: 13
    Last Post: 01-20-2021, 02:17 PM
  3. How can I convert a Word document to HTML email (VBA)
    By SidCharming in forum Programming
    Replies: 9
    Last Post: 08-03-2018, 02:10 AM
  4. Replies: 6
    Last Post: 06-20-2016, 01:29 PM
  5. How to Define a Hyperlink Data Type in SQL Server
    By EddieN1 in forum SQL Server
    Replies: 3
    Last Post: 02-07-2013, 11:26 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