Hollis,Virginia
HollisVJ at pgdp.usec.com
Wed Oct 22 06:49:48 CDT 2003
I have a database set up so an email notification is sent via Outlook for
new task assignments. I have not had any problems until converting the
database from 97 to A2K. Outlook will open with the message completed, but
after I press Send, I get a page fault error and it crashes:
MSACCESS caused an invalid page fault in module KERNEL32.DLL at
017f:bff7a138.
What can I do to prevent the database from crashing every time I press Send?
Why is it happening in A2K?
Virginia
This is the code I have on the button to send the emails.
*********************
'New assignment of EFR.
Dim Mess As String, Subject As String, Recipient As String, Cc As String,
Bcc As String
Dim Msg, Style, Title, Response, MyString
Beep
Msg = "Do you want to send a notification ?" ' Define message.
Style = vbYesNo + vbQuestion + vbDefaultButton1 ' Define buttons.
Title = "New EFR Assignment" ' Define title.
' Display message.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
Recipient = DLookup("[Initiator]", "qryInitiator",
"[EngineerID]=[Forms]![frmNewEFR]![EngineerID]")
Subject = "New Equipment Failure Report EFR-" +
CStr(Format([FailureReportNo], "00000"))
Cc = "Robert Cross; Chris Hoffman"
Bcc = "Virginia Hollis"
Mess = "You have been assigned the following Equipment Failure Report: "
+ vbCrLf + vbCrLf + _
"EFR-" + CStr(Format([FailureReportNo], "00000")) + vbCrLf + _
"Assigned to: " + DLookup("[Initiator]", "qryInitiator",
"[EngineerID]=[Forms]![frmNewEFR]![EngineerID]") + vbCrLf + _
"ATR: " + CStr([ATRNumber]) + vbCrLf + _
"Date assigned: " + CStr([DateMail]) + vbCrLf + vbCrLf + _
"Please complete your review within the next five (5) days."
On Error Resume Next
DoCmd.SendObject , , , Recipient, Cc, Bcc, Subject, Mess
Else ' User chose No.
MyString = "No" ' Perform some action.
End If
Exit_cmdNew_Click:
Exit Sub
Err_cmdNew_Click:
Select Case Err
Case 0 'insert Errors you wish to ignore here
Resume Next
Case Else 'All other errors will trap
Beep
MsgBox Error$, , "Error in function Form_frmNewEFR.cmdNew _Click"
Resume Exit_cmdNew_Click
End Select
Resume Next 'FOR TROUBLESHOOTING