A
albycindy
Hi everyone
I've been having a problem with the code below. On most of our computers it
works fine but on three (that seem to have an ActiveX component problem) it
does everything until it gets to the create new mail item section. Any
help/comments appreciated. Thanks
Private Sub cmdEmailLynx_Click()
Me.NotificationDate = Now()
Me.AdminName.SetFocus
Me.AdminPosition.SetFocus
Me.AdminPhone.SetFocus
Me.AdminEmail.SetFocus
Dim strWhere As String
strWhere = "[CRDNumber] = " & Me.[CRDNumber]
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Enter all information required!", vbExclamation
Else
DoCmd.OpenReport "rptLynxRequest", acViewPreview, , strWhere
Dim strSavedClaim As String
strSavedClaim = "C:\WUTemp\" & "rptLynxRequest" & ".snp"
DoCmd.OutputTo acOutputReport, , acFormatSNP, strSavedClaim, 0
DoCmd.Close
End If
DoCmd.Close acReport, "rptLynxRequest"
Dim Olk As Object
Dim OlkMsg As Object
Set Olk = CreateObject("Outlook.Application")
Set OlkMsg = Olk.CreateItem(0)
OlkMsg.To = "(e-mail address removed)"
OlkMsg.Subject = "Claim on Consignment " & Me![ConsignmentNumber]
OlkMsg.Body = "Dear Jonathan" & vbCrLf & vbCrLf & "Please find attached
a Notification for Claim form." & vbCrLf & vbCrLf & Me![AdminName] & vbCrLf &
"Metroplan Ltd"
OlkMsg.Attachments.Add strSavedClaim
OlkMsg.Display
Set Olk = Nothing
Set OlkMsg = Nothing
Kill ("C:\WUTemp\rptLynxRequest.snp")
End Sub
I've been having a problem with the code below. On most of our computers it
works fine but on three (that seem to have an ActiveX component problem) it
does everything until it gets to the create new mail item section. Any
help/comments appreciated. Thanks
Private Sub cmdEmailLynx_Click()
Me.NotificationDate = Now()
Me.AdminName.SetFocus
Me.AdminPosition.SetFocus
Me.AdminPhone.SetFocus
Me.AdminEmail.SetFocus
Dim strWhere As String
strWhere = "[CRDNumber] = " & Me.[CRDNumber]
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Enter all information required!", vbExclamation
Else
DoCmd.OpenReport "rptLynxRequest", acViewPreview, , strWhere
Dim strSavedClaim As String
strSavedClaim = "C:\WUTemp\" & "rptLynxRequest" & ".snp"
DoCmd.OutputTo acOutputReport, , acFormatSNP, strSavedClaim, 0
DoCmd.Close
End If
DoCmd.Close acReport, "rptLynxRequest"
Dim Olk As Object
Dim OlkMsg As Object
Set Olk = CreateObject("Outlook.Application")
Set OlkMsg = Olk.CreateItem(0)
OlkMsg.To = "(e-mail address removed)"
OlkMsg.Subject = "Claim on Consignment " & Me![ConsignmentNumber]
OlkMsg.Body = "Dear Jonathan" & vbCrLf & vbCrLf & "Please find attached
a Notification for Claim form." & vbCrLf & vbCrLf & Me![AdminName] & vbCrLf &
"Metroplan Ltd"
OlkMsg.Attachments.Add strSavedClaim
OlkMsg.Display
Set Olk = Nothing
Set OlkMsg = Nothing
Kill ("C:\WUTemp\rptLynxRequest.snp")
End Sub