G
Guest
I have a helpdesk application that records customer calls.
The main form (which selects the customer) has a subform
(FRM_Log_Entry_Subform) showing all calls. This subform has a subform showing
actions against the call.
The main form has a button to email call details which works fine.
What I need to do is retrieve all of the actions from the second subform
(FRM_Log_Entry_Actions_Subform) to email those as well.
Current code is shown below, any assistance much appreciated!
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Set the Subject, Body, and Importance of the message.
.Subject = "Support Call " & [FRM_Log_Entry_Subform]![Our Log No:] & "
/ " & [FRM_Log_Entry_Subform]![Company Name]
.Body = _
vbCr _
&
"-----------------------------------------------------------------------------------" _
& vbCr & "Customer: " & [FRM_Log_Entry_Subform]![Company Name] &
" (" & [FRM_Log_Entry_Subform]![Europa ID] & ")" _
& vbCr & "System: " & [FRM_Log_Entry_Subform]![EDI System] & "
" & [FRM_Log_Entry_Subform]![EDI Comms Method] _
& vbCr &
"-----------------------------------------------------------------------------------" _
& vbCr _
& vbCr & "Log Number: " & [FRM_Log_Entry_Subform]![Our Log No:] _
& vbCr & "Status: " & [FRM_Log_Entry_Subform]![Status] _
& vbCr & "Created By: " & [FRM_Log_Entry_Subform]![Logged By:] _
& vbCr & "Created On: " & [FRM_Log_Entry_Subform]![Date:] & " " &
[FRM_Log_Entry_Subform]![Time:] _
& vbCr & "Cust Ref: " & [FRM_Log_Entry_Subform]![Their Log No:] _
& vbCr & "Cust Contact: " & [FRM_Log_Entry_Subform]![Cust Contact:] _
& vbCr & "Call Type: " & [FRM_Log_Entry_Subform]![TypeDes:] _
& vbCr _
&
"-----------------------------------------------------------------------------------" _
& vbCr & "Description:" _
& vbCr & [FRM_Log_Entry_Subform]![Detail:] _
& vbCr
.BodyFormat = olFormatRichText
If [FRM_Log_Entry_Subform]![Priority] = 1 Then
.Importance = olImportanceHigh
ElseIf [FRM_Log_Entry_Subform]![Priority] = 3 Then
.Importance = olImportanceLow
End If
objOutlookMsg.Display
.Send
End With
The main form (which selects the customer) has a subform
(FRM_Log_Entry_Subform) showing all calls. This subform has a subform showing
actions against the call.
The main form has a button to email call details which works fine.
What I need to do is retrieve all of the actions from the second subform
(FRM_Log_Entry_Actions_Subform) to email those as well.
Current code is shown below, any assistance much appreciated!
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Set the Subject, Body, and Importance of the message.
.Subject = "Support Call " & [FRM_Log_Entry_Subform]![Our Log No:] & "
/ " & [FRM_Log_Entry_Subform]![Company Name]
.Body = _
vbCr _
&
"-----------------------------------------------------------------------------------" _
& vbCr & "Customer: " & [FRM_Log_Entry_Subform]![Company Name] &
" (" & [FRM_Log_Entry_Subform]![Europa ID] & ")" _
& vbCr & "System: " & [FRM_Log_Entry_Subform]![EDI System] & "
" & [FRM_Log_Entry_Subform]![EDI Comms Method] _
& vbCr &
"-----------------------------------------------------------------------------------" _
& vbCr _
& vbCr & "Log Number: " & [FRM_Log_Entry_Subform]![Our Log No:] _
& vbCr & "Status: " & [FRM_Log_Entry_Subform]![Status] _
& vbCr & "Created By: " & [FRM_Log_Entry_Subform]![Logged By:] _
& vbCr & "Created On: " & [FRM_Log_Entry_Subform]![Date:] & " " &
[FRM_Log_Entry_Subform]![Time:] _
& vbCr & "Cust Ref: " & [FRM_Log_Entry_Subform]![Their Log No:] _
& vbCr & "Cust Contact: " & [FRM_Log_Entry_Subform]![Cust Contact:] _
& vbCr & "Call Type: " & [FRM_Log_Entry_Subform]![TypeDes:] _
& vbCr _
&
"-----------------------------------------------------------------------------------" _
& vbCr & "Description:" _
& vbCr & [FRM_Log_Entry_Subform]![Detail:] _
& vbCr
.BodyFormat = olFormatRichText
If [FRM_Log_Entry_Subform]![Priority] = 1 Then
.Importance = olImportanceHigh
ElseIf [FRM_Log_Entry_Subform]![Priority] = 3 Then
.Importance = olImportanceLow
End If
objOutlookMsg.Display
.Send
End With