I am using the code below to send out emails and it works great. The problem I am having is I have a subform on my main form that I would like to include in the body of the email. I have tried using Form!frmMain!subDetail.Form.Account but I get
Run-time error '438':
Object doesn't support this property or method.
I am hope someone out there can give me some assistances.
Thanks
Private Sub cmdSend_Click()
Dim strEmail, strSubject As String, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strEmail = CUID
strBody = FirstName & ",<BR>" & vbCrLf & _
"In conducting our monthly audits, we have identified discrepancies between what" & _
" Serives are showing on the Weekly Audit Reports and what is in the Billing System for (see list below)" & _
"It would be greatly appreciated if we could contact me by " & returndate & _
"so we can get this issue resolved as quickly as possible." & "<BR>" & "<BR>" & _
"Thank You," & "<BR>" & _
"Corporate Audit Team" & "<BR>" & _
"<BR>" _
strSubject = "Serivces not billing. " & _
"Customer: " & [Customer Name] & " " & _
" " & "Acct: " & [Customer Acct] & " " & _
[currentmonth] _
With objEmail
.To = strEmail
.Subject = strSubject
.HTMLBody = strBody
'.Send 'Will cause warning message
.Display
End With
Set objEmail = Nothing
End Sub
Run-time error '438':
Object doesn't support this property or method.
I am hope someone out there can give me some assistances.
Thanks
Private Sub cmdSend_Click()
Dim strEmail, strSubject As String, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
strEmail = CUID
strBody = FirstName & ",<BR>" & vbCrLf & _
"In conducting our monthly audits, we have identified discrepancies between what" & _
" Serives are showing on the Weekly Audit Reports and what is in the Billing System for (see list below)" & _
"It would be greatly appreciated if we could contact me by " & returndate & _
"so we can get this issue resolved as quickly as possible." & "<BR>" & "<BR>" & _
"Thank You," & "<BR>" & _
"Corporate Audit Team" & "<BR>" & _
"<BR>" _
strSubject = "Serivces not billing. " & _
"Customer: " & [Customer Name] & " " & _
" " & "Acct: " & [Customer Acct] & " " & _
[currentmonth] _
With objEmail
.To = strEmail
.Subject = strSubject
.HTMLBody = strBody
'.Send 'Will cause warning message
.Display
End With
Set objEmail = Nothing
End Sub