VB code

S

Simon

I have the following code that sends an email

DoCmd.SendObject , , , Me.Email, "", "", "Order Despatch", "Body of
Email Text", False, ""

Where i have typed Body of Email Text, i require the following text /
code

strBody = "Dear " & DLookup("[FirstName]", "tblCustomers",
"[CustomerNumber]=" & Me.CustomerNumber) & _
" " & DLookup("[LastName]", "tblCustomers", "[CustomerNumber]=" &
Me.CustomerNumber) & "," & vbCrLf & vbCrLf

strBody = strBody & "Order Number : "
strBody = strBody & Me.Type
strBody = strBody & Format(Me.OrderNumber, "####0000") & vbCrLf
strBody = strBody & "Order Ref : "
strBody = strBody & Me.OrderRef & vbCrLf & vbCrLf
strBody = strBody & "Your order for the following items has been
despatched" & vbCrLf & vbCrLf



how do i enter the following code into the email code


thanks
 
D

Douglas J. Steele

strBody = "Dear " & DLookup("[FirstName]", "tblCustomers",
"[CustomerNumber]=" & Me.CustomerNumber) & _
" " & DLookup("[LastName]", "tblCustomers", "[CustomerNumber]=" &
Me.CustomerNumber) & "," & vbCrLf & vbCrLf

strBody = strBody & "Order Number : "
strBody = strBody & Me.Type
strBody = strBody & Format(Me.OrderNumber, "####0000") & vbCrLf
strBody = strBody & "Order Ref : "
strBody = strBody & Me.OrderRef & vbCrLf & vbCrLf
strBody = strBody & "Your order for the following items has been
dispatched" & vbCrLf & vbCrLf

DoCmd.SendObject , , , Me.Email, "", "", "Order Despatch", strBody, False,
""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top