R
robboll
I launch Outlook form MS Access 2003 using the code under the double
line.
When I send the first email it works fine. But if I send another
email everything freezes up. I have to use the task manager to Kill
OUTLOOK. And then it is immediatly replace by another OUTLOOK
session
and the email window comes up. I was wondering if my code could be
improved to prevent that from happening. Any suggestions please!
RBollinger
=======================================================
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName, mTO, mCC, mSubject As String
stDocName = "frmSnapShot"
mTO = Forms!frmEmail!emailTO
mCC = Forms!frmEmail!emailCC
mSubject = Forms!frmEmail!Subject
mpath = Mid(Forms!frmIssues!FolderPath, InStr(1, Nz(Forms!
frmIssues!FolderPath), "#") + 1, 100)
DoCmd.SendObject acReport, stDocName, , mTO, mCC, , mSubject, IIf
(Forms!frmEmail!Check3 = -1, "Shared Directory:" & vbCrLf & mpath,
""), , False
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is:
"
& Err.Description
Resume Error_out
Error_out:
End Sub
line.
When I send the first email it works fine. But if I send another
email everything freezes up. I have to use the task manager to Kill
OUTLOOK. And then it is immediatly replace by another OUTLOOK
session
and the email window comes up. I was wondering if my code could be
improved to prevent that from happening. Any suggestions please!
RBollinger
=======================================================
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName, mTO, mCC, mSubject As String
stDocName = "frmSnapShot"
mTO = Forms!frmEmail!emailTO
mCC = Forms!frmEmail!emailCC
mSubject = Forms!frmEmail!Subject
mpath = Mid(Forms!frmIssues!FolderPath, InStr(1, Nz(Forms!
frmIssues!FolderPath), "#") + 1, 100)
DoCmd.SendObject acReport, stDocName, , mTO, mCC, , mSubject, IIf
(Forms!frmEmail!Check3 = -1, "Shared Directory:" & vbCrLf & mpath,
""), , False
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is:
"
& Err.Description
Resume Error_out
Error_out:
End Sub