L
Les
I am using the code below to populate the message field of Outlook.
Although I have a Crlf command to break each line this is ignored when it
passes to outlook.
Is there a way to format this to do the line return or even put the output
in a Table format.
Thank
Les
Dim stDocName As String
Dim Rpt As String
Rpt = ""
Set rstRecips = CurrentDb.OpenRecordset("tblOrder_Details") 'table Name
If rstRecips.BOF Then 'BOF=no results from tbl
MsgBox "There Are No Orders To Send."
Else
rstRecips.MoveFirst
Do
Prcode = DLookup("strProduct_Code", "tblOrder_Details")
Prdis = DLookup("strProduct_Description", "tblOrder_Details")
PrdPrice = DLookup("curRetail_Price", "tblOrder_Details")
PrdQuan = DLookup("numQuantity", "tblOrder_Details")
PrdTot = DLookup("curTotal", "tblOrder_Details")
Rpt = Rpt & vbCrLf & "" & Prcode & " " & Prdis & " " & " £" & PrdPrice &
" Quanity" & "[ " & PrdQuan & "] " & " £" & PrdTot
rstRecips.MoveNext
Loop Until rstRecips.EOF
End If
rstRecips.Close
Set rstRecips = Nothing
'Send Email with attached doc
stDocName = "rptOrder_Report"
DoCmd.SendObject acReport, stDocName, acFormatRTF, "am email address", ,
, "Request", " " & Rpt & ""
Although I have a Crlf command to break each line this is ignored when it
passes to outlook.
Is there a way to format this to do the line return or even put the output
in a Table format.
Thank
Les
Dim stDocName As String
Dim Rpt As String
Rpt = ""
Set rstRecips = CurrentDb.OpenRecordset("tblOrder_Details") 'table Name
If rstRecips.BOF Then 'BOF=no results from tbl
MsgBox "There Are No Orders To Send."
Else
rstRecips.MoveFirst
Do
Prcode = DLookup("strProduct_Code", "tblOrder_Details")
Prdis = DLookup("strProduct_Description", "tblOrder_Details")
PrdPrice = DLookup("curRetail_Price", "tblOrder_Details")
PrdQuan = DLookup("numQuantity", "tblOrder_Details")
PrdTot = DLookup("curTotal", "tblOrder_Details")
Rpt = Rpt & vbCrLf & "" & Prcode & " " & Prdis & " " & " £" & PrdPrice &
" Quanity" & "[ " & PrdQuan & "] " & " £" & PrdTot
rstRecips.MoveNext
Loop Until rstRecips.EOF
End If
rstRecips.Close
Set rstRecips = Nothing
'Send Email with attached doc
stDocName = "rptOrder_Report"
DoCmd.SendObject acReport, stDocName, acFormatRTF, "am email address", ,
, "Request", " " & Rpt & ""