Good evening,
I have been messing around with a code that I want to apply to the form close command.
Right now I have a form specifically designated for adding new records. When a user closes the form, I would like an email generated capturing the form in a pdf and automatically sending it to me or whatever management parties.
I created a separate button for testing purposes, and it works, kinda. I get the popup from Microsoft Outlook stating a program is trying to send an e-mail message on your behalf.
Any work arounds to avoid this message from appearing? Simply put, I do not want the user to deny the message when a record is created.
I have been messing around with a code that I want to apply to the form close command.
Right now I have a form specifically designated for adding new records. When a user closes the form, I would like an email generated capturing the form in a pdf and automatically sending it to me or whatever management parties.
I created a separate button for testing purposes, and it works, kinda. I get the popup from Microsoft Outlook stating a program is trying to send an e-mail message on your behalf.
Any work arounds to avoid this message from appearing? Simply put, I do not want the user to deny the message when a record is created.
Code:
Private Sub Command384_Click()
On Error GoTo Err_Command384_Click
Dim strTo As String, strSubject As String, strText As String
strTo = [EMAIL="myemail@something.com"]myemail@something.com[/EMAIL]
strSubject = "New Purchase Order Created"
strText = "A new purchase order was created"
DoCmd.SendObject acSendForm, "ReviewPurchaseOrder", acFormatPDF, strTo, , , strSubject, strText, False
Exit_Command384_Click:
Exit Sub
Err_Command384_Click:
MsgBox Err.Description
Resume Exit_Command384_Click
End Sub