Carriage Return for an automated email

jdp103

Registered User.
Local time
Today, 03:18
Joined
Sep 26, 2003
Messages
46
I have a button on my form that will open up and email message in outlook. I need to be able to prefill out the body of the email with two separate paragraphs. The problem I am having is I can't get a carriage return to work between the paragraphs..it keeps showing up as one big paragraph. I've tried Chr(10) & Chr(13) and that doesn't work. Here is my code:

Private Sub NotifyCustomer_Click()
Dim emailrec As String
Dim intoptions As Integer
Dim stLinkCriteria As String
Dim title As String
Dim resp As Byte
Dim desc As String
Dim cr As String
cr = Chr(13) & Chr(10)

stLinkCriteria = Me![BRD Type] & "-" & Me![BRD Number]
title = Me![BRD Title]
desc = Me![BRD Description]
resp = MsgBox("Would you like to send an email to the customer informing them of the status of this Request?", vbOKCancel)
If resp = vbOK Then
DoCmd.SendObject acSendNoObject, , , , , , "Status of Wholesale Support Request" + " - " + title + " - " + stLinkCriteria, "This is to inform you that " + stLinkCriteria + " has been completed. Please use this number to reference this request in any communication with Wholesale Support. Thank you." + cr + desc
End If

End Sub


Any ideas???
 
I assume that EmailRec is the receipient which you never included. I changed it to strEmailRec.

Tidied up.


Code:
Private Sub NotifyCustomer_Click()

    Dim strEmailRec As String
    Dim strLinkCriteria As String
    Dim strTitle As String
    Dim strMessage As String
    Dim strDesc As String
    
    Const Subject = "Status of Wholesale Support Request"
    Const Question = "Would you like to send an email to the customer informing them of the status of this Request?"
    Const CR = vbCrLf & vbCrLf
    
    strLinkCriteria = Me.[BRD Type] & "-" & Me.[BRD Number]
    
    strTitle = Me.[BRD Title]
    strDesc = Me.[BRD Description]
    
    strMessage = "This is to inform you that " & stLinkCriteria & " has been completed. " & _
        "Please use this number to reference this request in any communication with " & _
        "Wholesale Support. Thank you." & CR & strDesc
    
    If MsgBox(Question, vbOKCancel) = vbOK Then
        DoCmd.SendObject acSendNoObject, , acFormatTXT, strEmailRec, , , Subject & " - " & strTitle & " - " & strLinkCriteria, strMessage, False
    End If

End Sub
 
Worked perfect! Thanks!
 
strLinkCriteria = Me.[BRD Type] & "-" & Me.[BRD Number]

I'm trying to figure out what is supposed to go in the BRD Type and BRD Number. Are these 2 fields in the table?
 
The jdp's table?

You say they are in the jdps table, but I don't see that table referenced anywhere. Is what the Me. is?
strLinkCriteria = Me.[BRD Type] & "-" & Me.[BRD Number]
So it would be Me. = table name?
[BRD Type] = a field in the Me. table?
[BRD Number, Title, Description] = all fields in that table?
 

Users who are viewing this thread

Back
Top Bottom