I have a button on a form (frmEmail) that opens a blank email in Outlook. I want it to close the form (frmEmail) sort of at the same time that the blank email opens.
Can anyone tell me what I should do?
I also tried all of that but with:
Can anyone tell me what I should do?
Code:
Private Sub cmdSendEmail_Click()
On Error GoTo Err_cmdSendEmail_Click
Dim stDocName As String
stDocName = "Empty_Report"
' DoCmd.SendObject acReport, stDocName
'DoCmd.SendObject acSendNoObject, stDocName, acFormatXLS, to, cc, bcc, subject, body, True
DoCmd.SendObject acSendNoObject, stDocName, acFormatXLS, Me.EmailTo, "support@google.com", , Me.Subject, Me.Body1 & vbCrLf & vbCrLf & Me.Body2, True
Exit_cmdSendEmail_Click:
Exit Sub
Err_cmdSendEmail_Click:
MsgBox Err.Description
Resume Exit_cmdSendEmail_Click
DoCmd.Close acForm, "frmEmail"
End Sub
I also tried all of that but with:
Code:
DoCmd.Close acForm, Me.Name