Hi Guy's i am still getting all on one line, as Moke 123 in post 12 states, it will become one line, how do i now separate the 2 records in this instance to 2 lines ?? mTotal states there is 2 but the line is now separated with the pipes, i am probably not understanding correctly, please forgive me
in the snip below, i have separated the 2 items black and red, the red line should be under the black one (new Line), if there were 10 records in the mBody (recordset) then 10 lines, I have highlighted (j) in the html body is related to vtext
Once again, thank you guy's i think i am not understanding correctly!!, i would be very grateful if you add or tweak or tell where to add what ??
vText = Replace(Replace(Replace(mBody, "." & Chr(13) & Chr(10), "|"), ".", "|"), Chr(13) & Chr(10), "|")
While InStr(vText, "||") <> 0
vText = Replace(vText, "||", "|")
Wend
' Set MyItem = MyApp.CreateItem(olMailItem)
' With MyItem
' .To = "deliveries@removed.co.uk"
' .subject = mDriver & " " & Format(Me.txtDelDate, "dd-mm-yy")
' .Body = mDriver & " - " & Me.txtDelDate & Chr(10) & Chr(10) & _
' mTotal & " " & "items for delivery" & Chr(10) & Chr(10) & _
' "DMT Consignment:" & " " & "C" & DLookup("RecordNo", "tblCustomers", "[Name] = '" & MyCus & "'") & "-" & Me.txtCurrentSheet & Chr(10) & Chr(10) & _
' DMTBody
'.Send
' End With
'End If
If Left(Me.txtCustomer, 3) <> "Gli" Then
If MsgBox("Print 2 x Delivery Notes For:" & Chr(10) & Chr(10) & _
Me.cboIndex3Print & Chr(10) & Chr(10) & _
"Total Items:" & " " & mTotal, vbQuestion + vbYesNo, "PRINT DELIVERY NOTES") = vbNo Then
DoCmd.CancelEvent
Else
DoCmd.OpenReport "rptDeliveryNote", acViewNormal
DoCmd.OpenReport "rptDeliveryNote", acViewNormal
End If
End If
sldLne = "-------------------------------------------------------------------------------------------------"
Lne = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."
a = TOD & ", " & "Please details of deliveries now assigned for:" & " " & Me.cboIndex3Print.Column(0) & "-" & Me.cboIndex3Print.Column(1)
b = "Attached is a copy of the consignment."
c = "DRIVER DETAILS:"
d = Chr(149) & " Delivery Date: " & Chr(149) & " " & Format(Me.txtDelDate, "dddd-dd-mmm-yyyy")
e = Chr(149) & " Delivery Driver: " & Chr(149) & " " & mDriver & " " & mDriverContact
f = Chr(149) & " Vehicle: " & Chr(149) & " " & Me.cboVehicle
g = "DELIVERY TO:"
h = Chr(149) & " " & Me.cboIndex3Print.Column(0) & " - " & Me.cboIndex3Print.Column(1) & " " & Chr(149)
h2 = "OUR REF: " & Me.txtCurrentSheet & "-" & mRec
j = vText
k = "Due to the current global pandemic situation, we would prefer for our drivers do sign any paperwork on your behalf to prevent any unnecessary handling."
l = "Once you can confirm your delivery is present and correct, you can respond to this email to confirm if you wish to."
'm = "Our Ref: " & Me.txtCurrentSheet & "-" & mRec
Set MyItem = MyApp.CreateItem(olMailItem)
Set OutAccount = MyApp.Session.Accounts.Item(1)
'BodyMessage = TOD & ", " & "Please find attached an update of deliveries now assigned for:" & " " & Me.cboIndex3Print.Column(0) & "-" & Me.cboIndex3Print.Column(1)
With MyItem
.To = MailTo
.CC = mCC & ";" & "deliveries@removed.co.uk"
.subject = Me.cboIndex3Print.Column(1) & " " & "Delivery Assigned For" & " " & Format(Me.txtDelDate, "ddd-dd-mmm-yy")
.Attachments.Add "T:\Fld1\PDF\Delivery Notes" & Me.cboIndex3Print.Column(0) & " " & Format(Me.txtDelDate, "dd-mm-yy") & ".pdf"
.HTMLBody = a & "<br>" & "<br>" & b & "<br>" & "<br>" & sldLne & "<br>" & c & "<br>" & d & "<br>" & e & "<br>" & f & "<br>" & sldLne & "<br>" & g & "<br>" & _
h & "<br>" & sldLne & "<br>" & "<br>" & h2 & "<br>" & sldLne & "<br>" & "<br>" & j & "<br>" & "<br>" & sldLne & "<br>" & "<br>" & k & "<br>" & "<br>" & l & "<br>" & "<br>" & _
"Kindest Regards" & "<br>" & "<br>" & n & "<br>" & _
fName & "<br>" & "<br>" & _
"<P><IMG border=0 hspace=0 alt='' src='file://T:/OurCompany/Logo Media/DMT dispatch@ Email Signature.jpg' align=baseline></P>" & "<br>" & "<br>" & _
"<FONT color=#00008B>" & eDisc & "<br>" & "<FONT color =#00008B>" & eDisc2[/CODE]
Resulting in 2 records on the same line below