I have code behind a button that triggers an email be sent (via Outlook) to notify a user of a change. I'm getting this message on one of 35 user's machine, and this message only started appearing today --- this user has been using the application for a year. I've done research online and what I've found points to corruption in Outlook or some other feature of Windows. I am bamboozled as to why, all of the sudden, this is a problem. Every other user is able to perform this task (click a button, send an email) without issue, which tells me it's not an error in the code but something particular with this user's machine. I've even installed another front end on the machine, but receive the same error message.
Can anyone offer any insight to this? Any help would be greatly appreciated!!
SetUp: Outlook 2016 32-bit, Access 2016 32-bit, front end installed on each user's desktop, back end installed on server, Windows 7 professional.
CODE:
Code:
On Error GoTo cmdErrHandler
Dim ctl As Control
Dim ol As Object
Dim strProperty As String
Dim strCC As String
Select Case Me.ENHEstStatusID_FK
Case 3, 4, 5
MsgBox "Estimate Is Already Marked Complete, Won, or Lost", vbCritical, "Error"
Exit Sub
End Select
[Forms]![ENHfrmProposal]![ENHfrmProposal_Services]![ENHRevenueStreamID_FK].Enabled = False
[Forms]![ENHfrmProposal]![ENHfrmProposal_Services]![ENHRevenueSubStreamID_FK].Enabled = False
[Forms]![ENHfrmProposal]![ENHfrmProposal_Services]![cmdDeleteService].Enabled = False
If Me.OperationsManagerID_FK.Value = 38 Then
strCC = "eric@crabapple.com"
Else
strCC = ""
End If
Set ol = GetObject(, "Outlook.Application")
strProperty = DLookup("strPropertyName", "tblProperties", "[PropertyID] = " & Me.PropertyID_FK)
If ol Is Nothing Then
GoTo cmdErrHandler
Else
If MsgBox("Are You Sure You Want To Mark Complete?", vbYesNo, "Confirm Complete") = vbYes Then
If MsgBox("Do You Want To Send Notification Email?", vbYesNo, "Email") = vbYes Then
DoCmd.SendObject acSendNoObject, , , Me.Email, strCC, , "Estimate Complete For " & Me.EstimateDescription.Value & ": " & strProperty, _
"The estimate for " & Me.EstimateDescription.Value & " has been completed. Standard pricing comes to " _
& Format([Forms]![ENHfrmProposal]![ENHsfrmEstimatePrice]![SumOfStandardPricing].Value, "Currency"), True
End If
Else
Exit Sub
End If
End If
Me.ENHEstStatusID_FK.Value = 3
Me.Requery
'[Forms]![ENHfrmProposal]![ENHsfrmEstimatePrice]![ENHEstFinalPrice].Visible = True
DoCmd.RunCommand acCmdSaveRecord
Set ol = Nothing
Set ctl = Nothing
cmdErrHandler:
If Err.Number <> 0 Then
Call ErrorLog(Err.Number & ": " & Err.Description, "cmdMarkComplete_Click()", "ENHfrmSchedule", [Forms]![frmManagement_HiddenLogIn]![Manager])
End If
Select Case Err.Number
Case 0
Exit Sub
Case 2501
If MsgBox("Email Was Not Sent, Would You Like To Send Now?", vbYesNo, "Email Not Sent") = vbYes Then
Resume
Else
Exit Sub
End If
Case 429
MsgBox "Outlook Is Not Running; Please Open Outlook And Try Again", vbCritical, "Outlook Not Running"
Me.ENHEstStatusID_FK.Value = 2
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select