I'm using Office 2003 and have the following code in an Access data base:
Expand|Select|Wrap|Line Numbers
- Private Sub Command126_click()
- On Error GoTo Err_Command126_click
- Dim stDocName As String
- stDocName = "Ideas report - current record"
- DoCmd.SendObject acReport, stDocName, acFormatSNP, , , , "The attached initiative log may be of interest to you", "Title: " & Me.Title, N
- Err_Command126_click:
- MsgBox Err.Description
- Resume Exit_Command126_Click
- Exit_Command126_Click:
- Exit Sub
- End Sub
However, if I amend Start-up options not to Display Database Window. The same function generates the below message if the operator cancels the e-mail.
"The Send Object was Cancelled"
"You used a method of DoCmd object to carry out an action in VB, but then clicked cancel in the dialog box"
The form now locks and can only be exitted using CTRL+ALT+DEL
I've read lots of posts about error handling and Err 2501, but the error appears to be happening before it gets to the Error handling.
Please help I've been stuck for 6 hours now!