Can anyone help
I have a command button that carries out a send object (Email with attachement when clicked. However if the user cancels the email I get a debug error. On other buttons in my databse I get the accepted send action cancelled
Can you advise what I need to correct so I get the send action cancelled msgbox
Here is the code. the debug directs me to the send object line
Private Sub Email_Notification_of_Cost_Change_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.[EMAIL COST AUTHORISATION FOR MANAGERS APPROVAL].SetFocus
Forms![Cost Authorisation Non - Project Form]![Email Notification of Cost Change].Enabled = False
DoCmd.SendObject acSendReport, "Cost Authorisation Variation", acFormatSNP, , , , "Cost Variation for " & [PREFIX] & [ID] & " Costs have changed from £" & [Actual Cost] & " TO " & "£" & [Total Cost], "Cost Variation for " & [PREFIX] & [ID] & " Costs have changed from £" & [Actual Cost] & " TO " & "£" & [Total Cost] & " - Please see attached for detail of the cost authorisation", , False
Exit_Email_Notification_of_Cost_Change_Click:
Exit Sub
Err_Email_Notification_of_Cost_Change_Click:
MsgBox Err.Description
Resume Exit_Email_Notification_of_Cost_Change_Click
End Sub
Many thanks in anticipation of your help
I have a command button that carries out a send object (Email with attachement when clicked. However if the user cancels the email I get a debug error. On other buttons in my databse I get the accepted send action cancelled
Can you advise what I need to correct so I get the send action cancelled msgbox
Here is the code. the debug directs me to the send object line
Private Sub Email_Notification_of_Cost_Change_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.[EMAIL COST AUTHORISATION FOR MANAGERS APPROVAL].SetFocus
Forms![Cost Authorisation Non - Project Form]![Email Notification of Cost Change].Enabled = False
DoCmd.SendObject acSendReport, "Cost Authorisation Variation", acFormatSNP, , , , "Cost Variation for " & [PREFIX] & [ID] & " Costs have changed from £" & [Actual Cost] & " TO " & "£" & [Total Cost], "Cost Variation for " & [PREFIX] & [ID] & " Costs have changed from £" & [Actual Cost] & " TO " & "£" & [Total Cost] & " - Please see attached for detail of the cost authorisation", , False
Exit_Email_Notification_of_Cost_Change_Click:
Exit Sub
Err_Email_Notification_of_Cost_Change_Click:
MsgBox Err.Description
Resume Exit_Email_Notification_of_Cost_Change_Click
End Sub
Many thanks in anticipation of your help