RE: Create a hyperlink in a string value

Tech-Archive recommends: Speed Up your PC by fixing your registry



My quick-and-dirty solution is to put my cursor at the end of the text URL in
the message and press the spacebar. Outlook then converts the text to a link.

"Eka1618" wrote:

Hello,

I have an Access Database. In this database, durring several different
ocations an e-mail message will be generate and sent to whoever. What I want
to do is create a string of some sort that will store the location of the
database on the network, and then somehow add this string as a hyperlink to a
predefined e-mail message that generates when the e-mail itself generates. I
am using VB for Access, but no one in those forums seem to know how to create
a link I guess...

Here is the code that already generate the e-mail:

Private Sub btnSend_Click()

Dim emName, emName2 As String, varItem As Variant
Dim emailBody As String
Dim emailSubject As String

'Dim db As String
'db = "<a href = ""G:\Shared Files\Eng_Favs\Test
Database_4_14_08.accdb"">Test Database</a>"

emailSubject = "Product Test Request"

On Error GoTo btnSend_Click_error
If Me!lboRequestor.ItemsSelected.Count = 0 Then
MsgBox "Please select a test requestor"
Exit Sub
End If
Me.PART_NO.SetFocus
emailBody = "Hello, " & vbCrLf & vbCrLf & _
"A product test request has been issued for the following Part Number: " &
Me.PART_NO.Text & _
vbCrLf & vbCrLf & "Please log into the Product Engineering test database to
review this request, Thank You!"

On Error GoTo btnSend_Click_error
If Me!lboRequestee.ItemsSelected.Count = 0 Then
MsgBox "Please select a test requestee"
Exit Sub
End If

For Each varItem In Me!lboRequestee.ItemsSelected
emName = emName & Chr(34) & Me!lboRequestee.Column(2, varItem) & Chr(34) & ","
Next varItem

For Each varItem In Me!lboRequestor.ItemsSelected
emName2 = emName2 & Chr(34) & Me!lboRequestor.Column(2, varItem) & Chr(34) &
","
Next varItem

'remove the extra comma at the end
'add the requestor to the e-mail list recipients
emName2 = Left$(emName2, Len(emName2) - 1)
emName = emName & emName2

'send message
DoCmd.SendObject acSendNoObject, , , emName, , , emailSubject, emailBody,
True, False

DoCmd.Close acForm, "frmRequest", acSaveNo
DoCmd.OpenForm "frmMain", acNormal, , , , acDialog

btnSend_Click_error:
If Err.Number = 2501 Then
MsgBox "You just canceled the e-mail", vbCritical, "Alert"
End If

End Sub


.



Relevant Pages

  • Create a hyperlink in a string value
    ... to do is create a string of some sort that will store the location of the ... Dim emName, emName2 As String, varItem As Variant ... emailSubject = "Product Test Request" ...
    (microsoft.public.vb.syntax)
  • Create Link That opens an Access Database from an e-mail.
    ... message that will open up the database that sent the e-mail. ... emailSubject = "Product Test Request" ... For Each varItem In Me!lboRequestee.ItemsSelected ... emName = emName & emName2 ...
    (microsoft.public.access.forms)
  • Re: Code for List Boxes
    ... Private Function WhereString() As String ... Dim strWhere As String ... Dim strWhere1 As String ... For Each varItem In Me.lstMake.ItemsSelected ...
    (microsoft.public.access.modulesdaovba)
  • Re: Syntax Error (missing operator) in Query Expresison
    ... Private Function BuildWhereCondition(strControl As String) As String ... Dim varItem As Variant ... Dim strWhere As String ... Case Else 'Multiple Selection ...
    (microsoft.public.access.reports)
  • RE: Multiple Multi Select Opt to filter a report
    ... strWhere = BuildWhereCondition ... there were selections made in the list box is it added to the Where string. ... Dim varItem As Variant ...
    (microsoft.public.access.reports)