G
Guest
I know that everyone here volunteers their time, but could someone please
have a quick look at this post?
I have two buttons on my form (frmFirst). One to email the details entered on
the form to a set address(cmdCustomerCare) and another to email the details
to the email address jin a control on the form(cmdEmailResp). Now - I have
set them up exactly the same (gone through the properties of the control to
the OnClick event, written the code there) and the first one(cmdCustomerCare)
is working beautifully but the second one produces nothing. No email, no
flickers, no error message. Why? When they are practically the same? (posted
below)
Private Sub cmdCustomerCare_Click()
On Error GoTo Err_cmdCustomerCare_Click
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.Application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
Dim OlkRecip As Outlook.Recipient
Set OlkRecip = .Recipients.Add("(e-mail address removed)")
OlkRecip.Type = olTo
..Subject = "Customer Care Follow Up CRD" & Me![pkCRDNumber]
..Send
End With
Set Olk = Nothing
Set OlkMsg = Nothing
Set OlkRecip = Nothing
Exit_cmdCustomerCare_Click:
Exit Sub
Err_cmdCustomerCare_Click:
MsgBox Err.Description
Resume Exit_cmdCustomerCare_Click
End Sub
****************************
Private Sub cmdEmailResp_Click()
On Error GoTo Err_cmdEmailResp_Click
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.Application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
..To = "mailto:" & Me![RespPersonEmail]
..Subject = "Message - Query to follow up"
..Body = "Please follow up on " & Me![pkCRDNumber]
..Send
End With
Set Olk = Nothing
Set OlkMsg = Nothing
Exit_cmdEmailResp_Click:
Exit Sub
Err_cmdEmailResp_Click:
MsgBox Err.Description
Resume Exit_cmdEmailResp_Click
End Sub
*****************************
have a quick look at this post?
I have two buttons on my form (frmFirst). One to email the details entered on
the form to a set address(cmdCustomerCare) and another to email the details
to the email address jin a control on the form(cmdEmailResp). Now - I have
set them up exactly the same (gone through the properties of the control to
the OnClick event, written the code there) and the first one(cmdCustomerCare)
is working beautifully but the second one produces nothing. No email, no
flickers, no error message. Why? When they are practically the same? (posted
below)
Private Sub cmdCustomerCare_Click()
On Error GoTo Err_cmdCustomerCare_Click
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.Application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
Dim OlkRecip As Outlook.Recipient
Set OlkRecip = .Recipients.Add("(e-mail address removed)")
OlkRecip.Type = olTo
..Subject = "Customer Care Follow Up CRD" & Me![pkCRDNumber]
..Send
End With
Set Olk = Nothing
Set OlkMsg = Nothing
Set OlkRecip = Nothing
Exit_cmdCustomerCare_Click:
Exit Sub
Err_cmdCustomerCare_Click:
MsgBox Err.Description
Resume Exit_cmdCustomerCare_Click
End Sub
****************************
Private Sub cmdEmailResp_Click()
On Error GoTo Err_cmdEmailResp_Click
Dim Olk As Outlook.Application
Set Olk = CreateObject("Outlook.Application")
Dim OlkMsg As Outlook.MailItem
Set OlkMsg = Olk.CreateItem(olMailItem)
With OlkMsg
..To = "mailto:" & Me![RespPersonEmail]
..Subject = "Message - Query to follow up"
..Body = "Please follow up on " & Me![pkCRDNumber]
..Send
End With
Set Olk = Nothing
Set OlkMsg = Nothing
Exit_cmdEmailResp_Click:
Exit Sub
Err_cmdEmailResp_Click:
MsgBox Err.Description
Resume Exit_cmdEmailResp_Click
End Sub
*****************************