kgranneman
New member
- Local time
- Yesterday, 19:06
- Joined
- Dec 11, 2008
- Messages
- 6
I created a form which triggers an email message. If the message is "closed" without saving or sending the system returns a 2501 error.
I trapped the error and entered handling code which works on my system with the full version of Access 2010. However when the database is packaged with Runtime 2010 and installed on another PC, the 2501 returns and the form locks. The only way out is Ctrl-Atl-Del.
I added code to Exit the Sub on Error but it still didn't work.
Can someone review this and tell me what's missing? Thanks.
Private Sub cmdbtn_email_Click()
On Error GoTo CancelError
DoCmd.Hourglass True
DoCmd.SendObject acReport, "rpt_FUVisits", "PDFFormat(*.pdf)", "", "", "", "Appointment Confirmation - Subject# " + Me!StudyID + " " + Me!VerID + " " + PtID, "", True, ""
Me!FUDate.SetFocus
DoCmd.Hourglass False
Exit Sub
CancelError:
If Err.Number = 2501 Then
MsgBox "The Appointment Confirmation has not been sent!", vbOKOnly, "Cancel Email"
Me!FUDate.SetFocus
DoCmd.Hourglass False
Exit Sub
End If
End Sub
I trapped the error and entered handling code which works on my system with the full version of Access 2010. However when the database is packaged with Runtime 2010 and installed on another PC, the 2501 returns and the form locks. The only way out is Ctrl-Atl-Del.
I added code to Exit the Sub on Error but it still didn't work.
Can someone review this and tell me what's missing? Thanks.
Private Sub cmdbtn_email_Click()
On Error GoTo CancelError
DoCmd.Hourglass True
DoCmd.SendObject acReport, "rpt_FUVisits", "PDFFormat(*.pdf)", "", "", "", "Appointment Confirmation - Subject# " + Me!StudyID + " " + Me!VerID + " " + PtID, "", True, ""
Me!FUDate.SetFocus
DoCmd.Hourglass False
Exit Sub
CancelError:
If Err.Number = 2501 Then
MsgBox "The Appointment Confirmation has not been sent!", vbOKOnly, "Cancel Email"
Me!FUDate.SetFocus
DoCmd.Hourglass False
Exit Sub
End If
End Sub