I'm rather new to writing VB, well actually about 3 weeks, so please go easy.
I'm using Office 2003 and have the following code in an Access data base:
This works absolutely fine and generates an e-mail with attachment. If the user decides not to send the e-mail and cancel (i.e. close e-mail message without saving) it returns to the original form - fine.
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!
I'm using Office 2003 and have the following code in an Access data base:
Code:
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!
Comment