P
Pamela
I have a cmdbutton on my form to first spellcheck the record, then e-mail a
snapshot of a related report. All aspects of my code seem to be working
correctly but this "Error: 0" window opens. Any idea what may be causing
this and how to work around it? Thanks!!!!
Pamela
I'll post my code in case it helps:
Private Sub Command47_Click()
On Error GoTo StartOutLook_Error
Dim strDocName As String
Dim strwhere As String
strDocName = "rpt_AssnTest"
strwhere = "[ID]=" & Me!ID
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSpelling
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.OpenReport strDocName, acPreview, , strwhere
DoCmd.SendObject acReport, strDocName, acFormatSNP, [AppraiserName], , ,
[Claim Number] & " New Assignment", "Here's this new assignment. Please
contact the owner as soon as possible. Thanks!"
DoCmd.Close acReport, "rpt_AssnTest"
StartOutLook_Error:
If Err <> 2501 Then ' Ignore the error
MsgBox "Error: " & Err & " " & Error
End If
Exit_Command47_Click:
Exit Sub
Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click
End Sub
snapshot of a related report. All aspects of my code seem to be working
correctly but this "Error: 0" window opens. Any idea what may be causing
this and how to work around it? Thanks!!!!
Pamela
I'll post my code in case it helps:
Private Sub Command47_Click()
On Error GoTo StartOutLook_Error
Dim strDocName As String
Dim strwhere As String
strDocName = "rpt_AssnTest"
strwhere = "[ID]=" & Me!ID
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdSpelling
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.OpenReport strDocName, acPreview, , strwhere
DoCmd.SendObject acReport, strDocName, acFormatSNP, [AppraiserName], , ,
[Claim Number] & " New Assignment", "Here's this new assignment. Please
contact the owner as soon as possible. Thanks!"
DoCmd.Close acReport, "rpt_AssnTest"
StartOutLook_Error:
If Err <> 2501 Then ' Ignore the error
MsgBox "Error: " & Err & " " & Error
End If
Exit_Command47_Click:
Exit Sub
Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click
End Sub