I've got a form with a cotinuous form as a subform.
I've got an e-mail button which creates an e-mail based on details from the form.
How can I go about adding in the details of the subform into my e-mail. Obviously it would only contain records relevant to the main form.
The code for my e-mail is:
Thanks
Griff
I've got an e-mail button which creates an e-mail based on details from the form.
How can I go about adding in the details of the subform into my e-mail. Obviously it would only contain records relevant to the main form.
The code for my e-mail is:
Code:
Dim strBody As String
Dim olApp As Object
Set olApp = CreateObject("Outlook.Application")
If MsgBox("Do you wish to e-mail this report to someone?", vbYesNo + vbQuestion, "E-mail?") = vbYes Then
strBody = "CANFORD SERVICE REPORT - QUICK E-MAIL" & Chr(13)
strBody = strBody & Chr(13)
strBody = strBody & "Return No: " & ReturnNo & Chr(13)
strBody = strBody & "Company Name: " & CompanyName & Chr(13)
strBody = strBody & "Received From: " & NameOfContact & Chr(13)
strBody = strBody & "Date Received: " & DateReceived & Chr(13)
strBody = strBody & "Telephone No: " & TelephoneNo & Chr(13)
strBody = strBody & "New Sales Reference: " & NewSalesReference & Chr(13)
strBody = strBody & "Current Location: " & CurrentLocation & Chr(13)
strBody = strBody & Chr(13)
strBody = strBody & "Customers Comments: " & Chr(13) & CustomersComments & Chr(13)
strBody = strBody & Chr(13)
strBody = strBody & "Action Taken: " & Chr(13) & ActionTaken & Chr(13)
Set olMail = olApp.CreateItem(olMailItem)
olMail.Subject = "Canford Service Report - " & ReturnNo & ", " & ReceivedFrom
olMail.Body = strBody
olMail.Display
End If
Thanks
Griff