Hello,
I'm using the following code to generate an email.
The code runs fine but the this particular field uses the "New line in field" Enter Key Behavior so keeping the format is important.
My form field shows the following
But when i run the code it changes to,
How would i keep that formatting from the field?
I'm using the following code to generate an email.
Code:
Option Compare Database
Private Sub SendEmail_Click()
Dim olApp As New Outlook.Application
Dim mItem As Outlook.MailItem ' An Outlook Mail item
Set olApp = CreateObject("Outlook.Application")
Set mItem = olApp.CreateItem(olMailItem)
' Add the To/Subject/Body to the message and display the message
MessageTo = fConcatEMailAddr
Forms!frmMOCform.SetFocus
Subject = "MOC# " & [Forms]![frmMOCform]![MOCNum] & " Update"
MessageBody = "<b>An update has been made to an MOC in the Production MOC database. Please login and provide your response.</b>" & "<br>" _
& "<br>" _
& "<br>" _
& "MOC# " & Me.MOCNum & "<br>" _
& "Product Name: " & Me.PRODUCTNAME & "<br>" _
& "Product SAP Code: " & Me.PRODUCTSAPCODE & "<br>" _
& "<br>" _
& "<br>" _
& "<u>Update Notes</U>" & "<br>" _
& "<br>" _
& "<br>" _
& Me.Updates
With mItem
.To = MessageTo
.Subject = Subject
.HTMLBody = MessageBody
.Display ' To show the email message to the user
End With
' Release all object variables
Set mItem = Nothing
Set olApp = Nothing
MsgBox "MOC Update submitted successfully"
DoCmd.Close acForm, "frmUsersUpdate", acSaveYes
DoCmd.Close acForm, "frmMOCForm", acSaveYes
End Sub
The code runs fine but the this particular field uses the "New line in field" Enter Key Behavior so keeping the format is important.
My form field shows the following
Code:
abc
123
xyz
But when i run the code it changes to,
Code:
abc123xyz
How would i keep that formatting from the field?